PHP date_sunrise() İşlevi
Örnek
Lizbon, Portekiz için gün doğumu saatine bugün geri dönün:
<?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));
?>
Tanım ve Kullanım
date_sunrise() işlevi, belirli bir gün ve konum için gün doğumu zamanını döndürür.
İpucu: Belirtilen gün ve konum için gün batımı saatini döndürmek için date_sunset() işlevine bakın .
Sözdizimi
date_sunrise(timestamp, format, latitude, longitude, zenith, gmtoffset)
Parametre Değerleri
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 |
Teknik detaylar
Geri dönüş değeri: | Başarı durumunda, belirtilen biçimde gündoğumu zamanını döndürür . Başarısızlıkta YANLIŞ |
---|---|
PHP Sürümü: | 5+ |
PHP Değişiklik Günlüğü: | PHP 5.1: Bu işlev artık E_STRICT ve E_NOTICE saat dilimi hataları veriyor |
❮ PHP Tarih/Saat Referansı