xref: /PHP-7.1/ext/date/tests/bug13142.phpt (revision 7af945e2)
1--TEST--
2Bug #13142 (strtotime handling of "M d H:i:s Y" format)
3--INI--
4date.timezone=US/Eastern
5--SKIPIF--
6<?php
7if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
8	die("skip. set TZ env is not supported at runtime.");
9}
10if (!@putenv("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') {
11	die("skip unable to change TZ environment variable\n");
12}
13?>
14--FILE--
15<?php
16
17if (date('T') == 'GMT') {
18	putenv("TZ=EST5EDT4,M4.1.0,M10.5.0");
19}
20echo date("r\n", strtotime("Sep 04 16:39:45 2001"));
21echo date("r\n", strtotime("Sep 04 2001 16:39:45"));
22?>
23--EXPECT--
24Tue, 04 Sep 2001 16:39:45 -0400
25Tue, 04 Sep 2001 16:39:45 -0400
26