पीएचपी date_sunset () समारोह
उदाहरण
लिस्बन, पुर्तगाल के लिए आज सूर्यास्त का समय लौटाएं:
<?php
// Lisbon, Portugal:
// Latitude: 38.4 North, Longitude: 9 West
// Zenith ~= 90, offset: +1 GMT
echo("Lisbon, Portugal: Date: " . date("D M d Y"));
echo("<br>Sunset time: ");
echo(date_sunset(time(),SUNFUNCS_RET_STRING,38.4,-9,90,1));
?>
परिभाषा और उपयोग
date_sunset() फ़ंक्शन किसी निर्दिष्ट दिन और स्थान के लिए सूर्यास्त का समय देता है।
युक्ति: किसी निर्दिष्ट दिन और स्थान के लिए सूर्योदय का समय वापस करने के लिए date_sunrise() फ़ंक्शन देखें।
वाक्य - विन्यास
date_sunset(timestamp, format, latitude, longitude, zenith, gmtoffset)
पैरामीटर मान
Parameter | Description |
---|---|
timestamp | Required. Specifies the timestamp of the day from which the sunset time is taken |
format |
Optional. Specifies how to return the result:
|
latitude | Optional. Specifies the latitude of the location. Defaults to North. To specify a value for South, pass in a negative value |
longitude | Optional. Specifies the longitude of the location. Defaults to East. To specify a value for West, pass in a negative value |
zenith | Optional. Defaults to date.sunset_zenith |
gmtoffset | Optional. Specifies the difference between GMT and local time in hours |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | सफलता पर , निर्दिष्ट प्रारूप में सूर्यास्त का समय लौटाता है। विफलता पर FALSE |
---|---|
पीएचपी संस्करण: | 5+ |
चेंजलॉग: | PHP 5.1.0 से यह फ़ंक्शन E_STRICT और E_NOTICE समय क्षेत्र त्रुटियाँ उत्पन्न करता है |
❮ पीएचपी दिनांक/समय संदर्भ