Annotation of embedaddon/php/ext/date/tests/DateTime_fix_createFromFormat.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test fix for DateTime when date have textual day with dot or other special char at end
3: --FILE--
4: <?php
5:
6: //Set the default time zone
7: date_default_timezone_set('Europe/London');
8:
9: echo "*** Testing clone on DateTime objects ***\n";
10:
11: // Create a DateTime object..
12: $orig = new DateTime('2012-11-29 17:00:00');
13:
14: // String to parse
15: $string = "Thu., Nov. 29, 2012 5:00PM";
16:
17: // Create a DateTime object from format
18: $fromFormat = DateTime::createFromFormat( "D., M# j, Y g:iA", $string );
19:
20: echo "Format method: " . $orig->format("D., M. j, Y g:iA") . "\n";
21: echo "createFromFormat method: " . $fromFormat->format("D., M. j, Y g:iA") . "\n";
22:
23: ?>
24: ===DONE===
25: --EXPECTF--
26: *** Testing clone on DateTime objects ***
27: Format method: Thu., Nov. 29, 2012 5:00PM
28: createFromFormat method: Thu., Nov. 29, 2012 5:00PM
29: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>