xref: /PHP-8.1/ext/date/tests/bug80998.phpt (revision b0dd55b1)
1--TEST--
2Bug #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');
11echo $string, "\n";
12?>
13--EXPECT--
142021-04-05 11:00:00.000001
15