xref: /PHP-7.4/ext/date/tests/sunfuncts.phpt (revision 782352c5)
1--TEST--
2date_sunrise() and date_sunset() functions
3--INI--
4precision=13
5--FILE--
6<?php
7date_default_timezone_set('Asia/Jerusalem');
8for($a=1;$a<=12;$a++){
9	echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_TIMESTAMP,31.76670,35.23330,90.83,2)." ";
10	echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_STRING,31.76670,35.23330,90.83,2)." ";
11	echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_DOUBLE,31.76670,35.23330,90.83,2)."\n";
12
13	echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_TIMESTAMP,31.76670,35.23330,90.83,2)." ";
14	echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_STRING,31.76670,35.23330,90.83,2)." ";
15	echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_DOUBLE,31.76670,35.23330,90.83,2)."\n";
16}
17?>
18--EXPECTF--
191041395858 06:37 6.6274307083%d
201041432434 16:47 16.787476435%d
211044073871 06:31 6.5198435465%d
221044112440 17:14 17.233560530%d
231046491524 06:05 6.0901858662%d
241046533056 17:37 17.626724279%d
251049167610 05:26 5.4473483216%d
261049212759 17:59 17.988854003%d
271051757554 04:52 4.8761196793%d
281051805991 18:19 18.330987470%d
291054434782 04:33 4.5506171719%d
301054485634 18:40 18.676282498%d
311057026940 04:35 4.5946862151%d
321057078197 18:49 18.832651294%d
331059706395 04:53 4.8875657219%d
341059755854 18:37 18.626282855%d
351062385985 05:13 5.2182752537%d
361062432319 18:05 18.088728929%d
371064979083 05:31 5.5233314120%d
381065021981 17:26 17.439368589%d
391067658825 05:53 5.8959513887%d
401067698295 16:51 16.859972460%d
411070252367 06:19 6.3241991396%d
421070289384 16:36 16.606870705%d
43