diff options
-rw-r--r-- | ext/date/tests/bug30532.phpt | 23 | ||||
-rw-r--r-- | ext/date/tests/bug32086.phpt | 15 | ||||
-rw-r--r-- | ext/date/tests/bug32270.phpt | 25 | ||||
-rw-r--r-- | ext/date/tests/bug32555.phpt | 13 | ||||
-rw-r--r-- | ext/date/tests/bug32588.phpt | 13 |
5 files changed, 89 insertions, 0 deletions
diff --git a/ext/date/tests/bug30532.phpt b/ext/date/tests/bug30532.phpt new file mode 100644 index 0000000000..c0b5b5252b --- /dev/null +++ b/ext/date/tests/bug30532.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #30532 (strtotime - crossing daylight savings time) +--FILE-- +<?php +putenv("TZ=America/New_York"); +echo date('Y-m-d H:i:s', strtotime('2004-10-31 EDT +1 hour'))."\n"; +echo date('Y-m-d H:i:s', strtotime('2004-10-31 EDT +2 hours'))."\n"; +echo date('Y-m-d H:i:s', strtotime('2004-10-31 EDT +3 hours'))."\n"; + +echo "\n"; + +echo date('Y-m-d H:i:s', strtotime('2004-10-31 +1 hour'))."\n"; +echo date('Y-m-d H:i:s', strtotime('2004-10-31 +2 hours'))."\n"; +echo date('Y-m-d H:i:s', strtotime('2004-10-31 +3 hours'))."\n"; +?> +--EXPECT-- +2004-10-31 01:00:00 +2004-10-31 01:00:00 +2004-10-31 02:00:00 + +2004-10-31 01:00:00 +2004-10-31 01:00:00 +2004-10-31 02:00:00 diff --git a/ext/date/tests/bug32086.phpt b/ext/date/tests/bug32086.phpt new file mode 100644 index 0000000000..53da38910f --- /dev/null +++ b/ext/date/tests/bug32086.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #32086 (strtotime don't work in DST) +--FILE-- +<?php +putenv("TZ=America/Sao_Paulo"); +echo $i = strtotime("2004-11-01"), "\n"; +echo strtotime("+1 day", $i), "\n"; +echo $i = strtotime("2005-02-19"), "\n"; +echo strtotime("+1 day", $i), "\n"; +?> +--EXPECT-- +1099278000 +1099360800 +1108778400 +1108868400 diff --git a/ext/date/tests/bug32270.phpt b/ext/date/tests/bug32270.phpt new file mode 100644 index 0000000000..7f8b414118 --- /dev/null +++ b/ext/date/tests/bug32270.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #32270 (strtotime/date behavior) +--FILE-- +<?php +putenv("TZ=America/New_York"); + +echo date("m/d/Y H:i:s", -2145888000)."\n"; + +echo strtotime("Jan 1 1902")."\n"; + +echo date("m/d/Y H:i:s", -631123200)."\n"; + +echo strtotime("Jan 1 1950")."\n"; + +echo date("m/d/Y H:i:s", 946713600)."\n"; + +echo strtotime("Jan 1 2000")."\n"; +?> +--EXPECT-- +01/01/1902 00:00:00 +-2145888000 +01/01/1950 00:00:00 +-631123200 +01/01/2000 00:00:00 +946713600 diff --git a/ext/date/tests/bug32555.phpt b/ext/date/tests/bug32555.phpt new file mode 100644 index 0000000000..9743c006f1 --- /dev/null +++ b/ext/date/tests/bug32555.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #32555 (strtotime("tomorrow") can return false) +--FILE-- +<?php +putenv("TZ=US/Eastern"); + +$stamp = 1112427000; +print strftime('%c %Z',strtotime('now',$stamp)) ."\n"; +print strftime('%c %Z',strtotime('tomorrow',$stamp)) ."\n"; +?> +--EXPECT-- +Sat Apr 2 02:30:00 2005 EST +Sun Apr 3 00:00:00 2005 EST diff --git a/ext/date/tests/bug32588.phpt b/ext/date/tests/bug32588.phpt new file mode 100644 index 0000000000..6cf5ac92f8 --- /dev/null +++ b/ext/date/tests/bug32588.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #32588 (strtotime() error for 'last xxx' DST problem) +--FILE-- +<?php +putenv("TZ=America/New_York"); + +echo date('D Y/m/d/H:i:s', strtotime('last saturday', 1112703348)). "\n"; +echo date('D Y/m/d/H:i:s', strtotime("last sunday", 1112703348)). "\n"; +echo date('D Y/m/d/H:i:s', strtotime('last monday', 1112703348)). "\n"; +--EXPECT-- +Sat 2005/04/02/00:00:00 +Sun 2005/04/03/00:00:00 +Mon 2005/04/04/00:00:00 |