DateTime_data-absolute.inc 470 B

123456789101112131415161718192021222324
  1. <?php
  2. /*
  3. * Note: test names match method names in a set of PHPUnit tests
  4. * in a userland package. Please be so kind as to leave them.
  5. */
  6. date_default_timezone_set('America/New_York');
  7. /*
  8. * Absolute
  9. */
  10. echo "test_absolute_7: ";
  11. examine_diff('2009-01-14', '2009-01-07', 'P+0Y0M7DT0H0M0S', 7, true);
  12. echo "test_absolute_negative_7: ";
  13. examine_diff('2009-01-07', '2009-01-14', 'P+0Y0M7DT0H0M0S', 7, true);
  14. //14 - 7 = 7
  15. //7 + 7 = 14
  16. //
  17. //7 - 14 = -7
  18. //14 - 7 = 7