File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / date / tests / date_sunrise_and_sunset_basic.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:54 2012 UTC (12 years, 6 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_17p0, v5_3_10, HEAD
php

--TEST--
Basic test for date_sunrise and date_sunset based on example in PHP manual
--FILE--
<?php

date_default_timezone_set('UTC');

/* 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 strict msgs 
error_reporting(E_ALL & ~E_STRICT);

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===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>