पीएचपी date_sunrise () समारोह
उदाहरण
लिस्बन, पुर्तगाल के लिए आज सूर्योदय का समय लौटाएं:
<?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>Sunrise time: ");
echo(date_sunrise(time(),SUNFUNCS_RET_STRING,38.4,-9,90,1));
?>
परिभाषा और उपयोग
date_sunrise() फ़ंक्शन किसी निर्दिष्ट दिन और स्थान के लिए सूर्योदय का समय देता है।
युक्ति: किसी निर्दिष्ट दिन और स्थान के लिए सूर्यास्त का समय वापस करने के लिए date_sunset() फ़ंक्शन देखें।
वाक्य - विन्यास
date_sunrise(timestamp, format, latitude, longitude, zenith, gmtoffset)
पैरामीटर मान
Parameter | Description |
---|---|
timestamp | Required. Specifies the timestamp of the day from which the sunrise 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.sunrise_zenith |
gmtoffset | Optional. Specifies the difference between GMT and local time in hours |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | सफलता पर , निर्दिष्ट प्रारूप में सूर्योदय का समय लौटाता है। विफलता पर FALSE |
---|---|
पीएचपी संस्करण: | 5+ |
पीएचपी चेंजलॉग: | PHP 5.1: यह फ़ंक्शन अब E_STRICT और E_NOTICE समय क्षेत्र त्रुटियाँ जारी करता है |
❮ पीएचपी दिनांक/समय संदर्भ