DateTime_construct-dst-overlap.phpt 914 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. DateTime::__construct() -- fall daylight/standard overlap
  3. --CREDITS--
  4. Daniel Convissor <danielc@php.net>
  5. --FILE--
  6. <?php
  7. date_default_timezone_set('America/New_York');
  8. // PHP defaults to Daylight Saving Time. Ensure consistency in future.
  9. $d = new DateTime('2011-11-06 01:30:00');
  10. echo $d->format('P') . "\n";
  11. date_default_timezone_set('Atlantic/Azores');
  12. // PHP defaults to Daylight Saving Time. Ensure consistency in future.
  13. $d = new DateTime('2011-10-30 00:30:00');
  14. echo $d->format('P') . "\n";
  15. date_default_timezone_set('Europe/London');
  16. // PHP defaults to normal time. Ensure consistency in future.
  17. $d = new DateTime('2011-10-30 01:30:00');
  18. echo $d->format('P') . "\n";
  19. date_default_timezone_set('Europe/Amsterdam');
  20. // PHP defaults to normal time. Ensure consistency in future.
  21. $d = new DateTime('2011-10-30 02:30:00');
  22. echo $d->format('P') . "\n";
  23. ?>
  24. --EXPECT--
  25. -04:00
  26. +00:00
  27. +00:00
  28. +01:00