Re: New DateTime[Immutable]::createFromTimestamp

From: Date: Sat, 28 Oct 2023 15:47:17 +0000
Subject: Re: New DateTime[Immutable]::createFromTimestamp
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-121495@lists.php.net to get a copy of this message
Hi Rowan, > 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? Yes, I'm assuming a timestamp that includes up to microseconds. This is because in the last example of the PR description, the microsecond timestamp was expressed as a float. For information on the number of digits that guarantee float accuracy, please see the following documentation: https://www.php.net/manual/en/reserved.constants.php The constant PHP_FLOAT_DIG is its value. This is set to 16 for IBM and 15 for others. Regards. Saki

« previous php.internals (#121495) next »