Annotation of embedaddon/php/ext/date/tests/bug34771.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #34771 (strtotime() fails with 1-12am/pm)
! 3: --FILE--
! 4: <?php
! 5: date_default_timezone_set("UTC");
! 6:
! 7: $tests = array(
! 8: '12am', '1am', '1pm',
! 9: '12a.m.', '1a.m.', '1p.m.',
! 10: '12:00am', '1:00am', '1:00pm',
! 11: '12:00a.m.', '1:00a.m.', '1:00p.m.'
! 12: );
! 13:
! 14: foreach ($tests as $test) {
! 15: $t = strtotime("2005-12-22 ". $test);
! 16: printf("%-10s => %s\n", $test, date(DATE_ISO8601, $t));
! 17: }
! 18:
! 19: ?>
! 20: --EXPECT--
! 21: 12am => 2005-12-22T00:00:00+0000
! 22: 1am => 2005-12-22T01:00:00+0000
! 23: 1pm => 2005-12-22T13:00:00+0000
! 24: 12a.m. => 2005-12-22T00:00:00+0000
! 25: 1a.m. => 2005-12-22T01:00:00+0000
! 26: 1p.m. => 2005-12-22T13:00:00+0000
! 27: 12:00am => 2005-12-22T00:00:00+0000
! 28: 1:00am => 2005-12-22T01:00:00+0000
! 29: 1:00pm => 2005-12-22T13:00:00+0000
! 30: 12:00a.m. => 2005-12-22T00:00:00+0000
! 31: 1:00a.m. => 2005-12-22T01:00:00+0000
! 32: 1:00p.m. => 2005-12-22T13:00:00+0000
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>