xref: /PHP-7.0/ext/date/tests/sunfuncts.phpt (revision 60a6feed)
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--
191041395864 06:37 6.6290131458%d
201041432452 16:47 16.792451114%d
211044073855 06:30 6.5154089279%d
221044112463 17:14 17.239870289%d
231046491495 06:04 6.0822145033%d
241046533075 17:37 17.632011035%d
251049167581 05:26 5.4394438111%d
261049212774 17:59 17.993035729%d
271051757532 04:52 4.8701934126%d
281051806007 18:20 18.335390508%d
291054434776 04:32 4.5489827182%d
301054485647 18:40 18.679812949%d
311057026949 04:35 4.5971956372%d
321057078197 18:49 18.832563396%d
331059706409 04:53 4.8916575089%d
341059755837 18:37 18.621440704%d
351062385999 05:13 5.2220951121%d
361062432291 18:04 18.080957168%d
371064979098 05:31 5.5273199215%d
381065021952 17:25 17.431339135%d
391067658845 05:54 5.9016292870%d
401067698274 16:51 16.853902453%d
411070252387 06:19 6.3299242689%d
421070289382 16:36 16.606312600%d
43