bug13142.phpt 619 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #13142 (strtotime handling of "M d H:i:s Y" format)
  3. --INI--
  4. date.timezone=US/Eastern
  5. --SKIPIF--
  6. <?php
  7. if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
  8. die("skip. set TZ env is not supported at runtime.");
  9. }
  10. if (!@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. if (date('T') == 'GMT') {
  17. putenv("TZ=EST5EDT4,M4.1.0,M10.5.0");
  18. }
  19. echo date("r\n", strtotime("Sep 04 16:39:45 2001"));
  20. echo date("r\n", strtotime("Sep 04 2001 16:39:45"));
  21. ?>
  22. --EXPECT--
  23. Tue, 04 Sep 2001 16:39:45 -0400
  24. Tue, 04 Sep 2001 16:39:45 -0400