You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Datetime created from negative float timestamp is not monotonic (fraction part is added instead of substracted) #7758
For the explanation: fractional timestamps are currently not supported when parsing, which means PHP handles inputs like @-1.4 as an absolute "@-1" (1970 minus 1s) followed by a relative ".4" (plus 0.4s).
For the explanation: fractional timestamps are currently not supported when parsing, which means PHP handles inputs like @-1.4 as an absolute "@-1" (1970 minus 1s) followed by a relative ".4" (plus 0.4s).
this is how it is parsed currently probably, however if unix timestamp is negative, the fractional part must be decremented as if the whole TS was a standard floating point number
https://3v4l.org/rKOAb shows the fractional part cannot be even used alone (eg. parsed with @ts token and the parsing must be fixed)
Activity
damianwadley commentedon Dec 11, 2021
For the explanation: fractional timestamps are currently not supported when parsing, which means PHP handles inputs like
@-1.4as an absolute "@-1" (1970 minus 1s) followed by a relative ".4" (plus 0.4s).mvorisek commentedon Dec 13, 2021
this is how it is parsed currently probably, however if unix timestamp is negative, the fractional part must be decremented as if the whole TS was a standard floating point number
https://3v4l.org/rKOAb shows the fractional part cannot be even used alone (eg. parsed with
@tstoken and the parsing must be fixed)iluuu1994 commentedon Dec 13, 2021
I think it's fair to say that this a feature request as the docs do state that only whole numbers are supported.
Fix negative us in unix timestamp syntax
Fix negative us in unix timestamp syntax
Added test for: Fix negative us in unix timestamp syntax
hormus commentedon Apr 24, 2022
Fixed bug phpGH-7758 (Problems with negative timestamps and fractions)
tidy #66848 [Uid] Fix UuidFactoryTest on PHP < 8.1.7 (nicolas-grekas)