função PHP date_sunrise ()
PHP Data / Hora Manual de Referência
Exemplos
De regresso a Lisboa, Portugal hoje Nascer do sol:
<?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));
?>
// 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));
?>
Correndo instância »
Definição e Uso
função date_sunrise () retorna a data e local de tempo do nascer do sol.
Dica: Veja date_sunset () função retorna a data especificada e localização dos tempos do sol.
gramática
date_sunrise( timestamp,format,latitude,longitude,zenith,gmtoffset);
参数 | 描述 |
---|---|
timestamp | 必需。规定要计算日出时间的日期时间戳。 |
format |
可选。规定如何返回结果:
|
latitude | 可选。规定地点的纬度。默认是指北纬。因此如果要指定南纬,必须传递一个负值。 |
longitude | 可选。规定地点的经度。默认是指东经。因此如果要指定西经,必须传递一个负值。 |
zenith | 可选。默认为 date.sunrise_zenith。 |
gmtoffset | 可选。规定 GMT 与本地时间的差值。单位是小时。 |
detalhes técnicos
retorna: | Se for bem sucedido, coloca o formato especificado para retornar tempo do nascer do sol. Se ele falhar, ele retorna. |
---|---|
versão do PHP: | 5+ |
log Update: | A partir do PHP 5.1.0, este E_STRICT jornal função e erros fuso horário E_NOTICE. |
PHP Data / Hora Manual de Referência