summaryrefslogtreecommitdiff
path: root/ext/date/tests/date_sun_info_003.phpt
blob: 0caffdc295f3df08120f9d8d5744a6e0d8fb59f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--TEST--
Test basic date_sun_info()
--CREDITS--
edgarsandi - <edgar.r.sandi@gmail.com>
--FILE--
<?php
date_default_timezone_set('America/Sao_Paulo');
$sun_info = date_sun_info(strtotime("2015-01-12 00:00:00 UTC"), 89.00, 1.00);
foreach ($sun_info as $key => $elem ) {
    echo "$key: " . date("H:i:s", $elem) . "\n";
}

echo "\n";

$sun_info = date_sun_info(strtotime("2015-09-12 00:00:00 UTC"), 89.00, 1.00);
foreach ($sun_info as $key => $elem ) {
    echo "$key: " . date("H:i:s", $elem) . "\n";
}

echo "Done\n";
?>
--EXPECTF--
sunrise: 21:00:00
sunset: 21:00:00
transit: 10:04:02
civil_twilight_begin: 21:00:00
civil_twilight_end: 21:00:00
nautical_twilight_begin: 21:00:00
nautical_twilight_end: 21:00:00
astronomical_twilight_begin: 21:00:00
astronomical_twilight_end: 21:00:00

sunrise: 21:00:01
sunset: 21:00:01
transit: 08:52:30
civil_twilight_begin: 21:00:01
civil_twilight_end: 21:00:01
nautical_twilight_begin: 21:00:01
nautical_twilight_end: 21:00:01
astronomical_twilight_begin: 21:00:01
astronomical_twilight_end: 21:00:01
Done