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
Warning: Uncaught DateMalformedIntervalStringException: Unknown or bad format (PT0.5S)
But I expected this output instead:
DateInterval object with 500 milliseconds
The ISO Duration string can have the seconds set to a decimal fraction. I found this bug when Postgres returns Intervals with decimal fractions for seconds if required when returning a ISO8601 duration string.
From Wikipedia:
The smallest value used may also have a decimal fraction,[39] as in "P0.5Y" to indicate half a year. This decimal fraction may be specified with either a comma or a full stop, as in "P0,5Y" or "P0.5Y".
If necessary for a particular application the lowest order component may have a decimal fraction. The decimal fraction shall be divided from the integer part by the decimal sign specified in ISO 31-0: i.e. the comma [,] or full stop [.]. Of these, the comma is the preferred sign. If the magnitude of the number is less than unity, the decimal sign shall be preceded by a zero (see ISO 31-0);
PHP Version
PHP 8.3
Operating System
No response
The text was updated successfully, but these errors were encountered:
Description
The following code:
Resulted in this output:
But I expected this output instead:
The ISO Duration string can have the seconds set to a decimal fraction. I found this bug when Postgres returns Intervals with decimal fractions for seconds if required when returning a ISO8601 duration string.
From Wikipedia:
https://www.loc.gov/standards/datetime/iso-tc154-wg5_n0038_iso_wd_8601-1_2016-02-16.pdf
PHP Version
PHP 8.3
Operating System
No response
The text was updated successfully, but these errors were encountered: