On 28 October 2023 15:40:29 BST, Saki Takamachi <s...@sakiot.com> wrote: >Hi Marc, > >Personally, I don't think these are necessarily necessary since there is a >"from format".
As noted on the PR, both the default constructor and createFromFormat require the input to be converted to a string, which tends to make code messy. It's then converted back to an integer internally, which isn't very efficient. I would be in favour of adding this method. >I have one concern. float is imprecise, so I don't think it's suitable for >this kind of use. For timestamps, 16 digits are used, which exceeds the >guaranteed precision of 15 digits on non-IBM platforms. I'm not sure where you got those numbers; on a 64-bit architecture (surely the vast majority of PHP installs), a float can precisely represent any whole number from -2**53 up to 2**53 - 1. As a Unix timestamp, that's a one-second accuracy for any time 285 million years into the past or future. https://www.wolframalpha.com/input?i=2**53+as+unix+timestamp Possibly you're thinking of a representation that counts integers as milliseconds or microseconds, instead of seconds? Regards, -- Rowan Tommins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php