mirror of
https://github.com/php/php-src.git
synced 2024-10-02 15:26:06 +00:00
28 lines
735 B
Plaintext
28 lines
735 B
Plaintext
|
--TEST--
|
||
|
Basic test for date_sunrise and date_sunset based on example in PHP manual
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
/* calculate the sunrise time for Lisbon, Portugal
|
||
|
Latitude: 38.4 North
|
||
|
Longitude: 9 West
|
||
|
Zenith ~= 90
|
||
|
offset: +1 GMT
|
||
|
*/
|
||
|
|
||
|
echo "Basic test for date_sunrise() and date_sunset()\n";
|
||
|
|
||
|
// supress date() function warning msgs
|
||
|
error_reporting(E_ALL & ~E_WARNING);
|
||
|
|
||
|
echo date("D M d Y") . ', sunrise time : ' . date_sunrise(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1) . "\n";
|
||
|
echo date("D M d Y") . ', sunset time : ' . date_sunset(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1) . "\n";
|
||
|
|
||
|
?>
|
||
|
===Done===
|
||
|
--EXPECTF--
|
||
|
Basic test for date_sunrise() and date_sunset()
|
||
|
%s %s %d %d, sunrise time : %d:%d
|
||
|
%s %s %d %d, sunset time : %d:%d
|
||
|
===Done===
|