calendar_fieldDifference_basic.phpt 814 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. IntlCalendar::fieldDifference() basic test
  3. --INI--
  4. date.timezone=Atlantic/Azores
  5. --EXTENSIONS--
  6. intl
  7. --FILE--
  8. <?php
  9. ini_set("intl.error_level", E_WARNING);
  10. ini_set("intl.default_locale", "nl");
  11. $intlcal = IntlCalendar::createInstance('UTC');
  12. $intlcal->setTime(strtotime('2012-02-29 05:06:07 +0000') * 1000);
  13. var_dump(
  14. $intlcal->fieldDifference(
  15. strtotime('2012-02-29 06:06:08 +0000') * 1000,
  16. IntlCalendar::FIELD_SECOND),
  17. $intlcal->get(IntlCalendar::FIELD_HOUR_OF_DAY));
  18. $intlcal->setTime(strtotime('2012-02-29 05:06:07 +0000') * 1000);
  19. var_dump(
  20. intlcal_field_difference(
  21. $intlcal,
  22. strtotime('2012-02-29 06:07:08 +0000') * 1000,
  23. IntlCalendar::FIELD_MINUTE));
  24. ?>
  25. --EXPECT--
  26. int(3601)
  27. int(6)
  28. int(61)