File: date_sun_info_002.phpt

package info (click to toggle)
php5 5.6.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 150,376 kB
  • sloc: ansic: 727,510; php: 21,966; sh: 12,356; cpp: 8,763; xml: 6,105; yacc: 1,551; exp: 1,514; makefile: 1,461; pascal: 1,048; awk: 538; perl: 315; sql: 22
file content (23 lines) | stat: -rw-r--r-- 692 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
Test basic date_sun_info()
--FILE--
<?php
date_default_timezone_set('Europe/Oslo');
$sun_info = date_sun_info(strtotime("2007-04-13 08:31:15 UTC"), 59.21, 9.61);
foreach ($sun_info as $key => $elem )
{
	echo date( 'Y-m-d H:i:s T', $elem ),  " ", $key, "\n";
}
echo "Done\n";
?>
--EXPECTF--
2007-04-13 06:12:19 CEST sunrise
2007-04-13 20:31:50 CEST sunset
2007-04-13 13:22:05 CEST transit
2007-04-13 05:28:03 CEST civil_twilight_begin
2007-04-13 21:16:06 CEST civil_twilight_end
2007-04-13 04:30:08 CEST nautical_twilight_begin
2007-04-13 22:14:01 CEST nautical_twilight_end
2007-04-13 03:14:36 CEST astronomical_twilight_begin
2007-04-13 23:29:33 CEST astronomical_twilight_end
Done