timezone_getOffset_basic.phpt 686 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. IntlTimeZone::getOffset(): basic test
  3. --INI--
  4. date.timezone=Atlantic/Azores
  5. --SKIPIF--
  6. <?php
  7. if (!extension_loaded('intl'))
  8. die('skip intl extension not enabled');
  9. --FILE--
  10. <?php
  11. ini_set("intl.error_level", E_WARNING);
  12. $ams = IntlTimeZone::createTimeZone('Europe/Amsterdam');
  13. $date = strtotime("1 July 2012 +0000");
  14. var_dump($ams->getOffset($date *1000., true, $rawOffset, $dstOffset),
  15. $rawOffset, $dstOffset);
  16. $lsb = IntlTimeZone::createTimeZone('Europe/Lisbon');
  17. var_dump(intltz_get_offset($lsb, $date *1000., true, $rawOffset, $dstOffset),
  18. $rawOffset, $dstOffset);
  19. ?>
  20. ==DONE==
  21. --EXPECT--
  22. bool(true)
  23. int(3600000)
  24. int(3600000)
  25. bool(true)
  26. int(0)
  27. int(3600000)
  28. ==DONE==