PHP date_sunset() ফাংশন
প্রয়োগ
প端তুগাল পর্তুগালের আজকের সূর্যাস্তের সময় ফিরিয়ে দিন:
<?php // শাংহাই, চীন: // অক্ষ: উত্তর অক্ষতল 31.22, দ্রাঘিমাংশ: পশ্চিম 121.47 // শীর্ষপথ ~= 90, এক্সকিউয়াল: +8 GMT echo("শাংহাই, চীন: তারিখ: " . date("D M d Y")); echo("<br>সূর্যোদয়ের সময়:"); echo(date_sunrise(time(),SUNFUNCS_RET_STRING,31.22,121.47,90,8)); ?>
Definition and Usage
The date_sunset() function returns the sunset time for the specified date and location.
Tip:See also date_sunrise() Function, returns the sunrise time for the specified date and location.
Syntax
date_sunset(timestamp,format,latitude,longitude,zenith,gmtoffset);
Parameters | Description |
---|---|
timestamp | Required. Specifies the timestamp of the date and time to calculate the sunset time. |
format |
Optional. Specifies how to return the result:
|
latitude | Optional. Specifies the latitude of the location. Defaults to north latitude. To specify south latitude, pass a negative value. |
longitude | Optional. Specifies the longitude of the location. Defaults to east longitude. To specify west longitude, pass a negative value. |
zenith | Optional. Defaults to date.sunset_zenith. |
gmtoffset | Optional. Specifies the difference between GMT and local time in hours. |
Technical Details
Return Value: | If successful, returns the sunset time in the specified format. If failed, returns FALSE. |
---|---|
PHP Version: | 5+ |
Update Log: | Starting from PHP 5.1.0, the function reports E_STRICT and E_NOTICE time zone errors. |