Re: [RFC] Time\Instant and Time\Clock

From: Date: Tue, 29 Sep 2026 17:35:50 +0000
Subject: Re: [RFC] Time\Instant and Time\Clock
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-132699@lists.php.net to get a copy of this message
Hi On 2026-09-29 19:17, Tim Düsterhus wrote:
- The behavior of Instant::toIso8601DateTimeString() regarding fractional seconds was adjusted again: Trailing zeros will now be kept to make the precision supported by Time\Instant explicit. 2026-09-29T16:42:45.5Z could mean “exactly 0.5 seconds” or “0.5 seconds ± 0.05 seconds” whereas 2026-09-29T16:42:45.500000000Z is explicit as to how precise the data is. This might matter for consumers that also store an “uncertainty” range.
Forgot to mention, but it's in the RFC: The fractional part will be entirely omitted if it's zero. While that drops the explicit precision information in *that* case, it should also improve interoperability with consumers who are not prepared to handle fractional seconds. A consumer that already supports fractional seconds should be able to deal with trailing zeros just fine. Best regards Tim Düsterhus

« previous php.internals (#132699) next »