bug80998.phpt 337 B

1234567891011121314
  1. --TEST--
  2. Bug #80998: Missing second with inverted interval
  3. --FILE--
  4. <?php
  5. $date = new DateTime('2021-04-05 14:00:00');
  6. $interval = new DateInterval('P0DT10799S');
  7. $interval->f = 0.999999;
  8. $interval->invert = 1;
  9. $date->add($interval);
  10. $string = $date->format('Y-m-d H:i:s.u');
  11. echo $string, "\n";
  12. ?>
  13. --EXPECT--
  14. 2021-04-05 11:00:00.000001