xref: /PHP-8.1/ext/date/tests/sunfuncts.phpt (revision 5bb83b37)
1--TEST--
2date_sunrise() and date_sunset() functions
3--INI--
4precision=13
5error_reporting=E_ALL&~E_DEPRECATED
6--FILE--
7<?php
8date_default_timezone_set('Asia/Jerusalem');
9for($a=1;$a<=12;$a++){
10    echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_TIMESTAMP,31.76670,35.23330,90.83,2)." ";
11    echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_STRING,31.76670,35.23330,90.83,2)." ";
12    echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_DOUBLE,31.76670,35.23330,90.83,2)."\n";
13
14    echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_TIMESTAMP,31.76670,35.23330,90.83,2)." ";
15    echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_STRING,31.76670,35.23330,90.83,2)." ";
16    echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_DOUBLE,31.76670,35.23330,90.83,2)."\n";
17}
18?>
19--EXPECTF--
201041395858 06:37 6.6274307083%d
211041432434 16:47 16.787476435%d
221044073871 06:31 6.5198435465%d
231044112440 17:14 17.233560530%d
241046491524 06:05 6.0901858662%d
251046533056 17:37 17.626724279%d
261049167610 05:26 5.4473483216%d
271049212759 17:59 17.988854003%d
281051757554 04:52 4.8761196793%d
291051805991 18:19 18.330987470%d
301054434782 04:33 4.5506171719%d
311054485634 18:40 18.676282498%d
321057026940 04:35 4.5946862151%d
331057078197 18:49 18.832651294%d
341059706395 04:53 4.8875657219%d
351059755854 18:37 18.626282855%d
361062385985 05:13 5.2182752537%d
371062432319 18:05 18.088728929%d
381064979083 05:31 5.5233314120%d
391065021981 17:26 17.439368589%d
401067658825 05:53 5.8959513887%d
411067698295 16:51 16.859972460%d
421070252367 06:19 6.3241991396%d
431070289384 16:36 16.606870705%d
44