Re: [RFC] Time\Instant and Time\Clock
| From: | Morgan | Date: | Wed, 30 Sep 2026 19:10:26 +0000 |
| Subject: | Re: [RFC] Time\Instant and Time\Clock | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-132728@lists.php.net to get a copy of this message | ||
On 2026-10-01 06:40, Mirco Babin wrote:
========= Comment 2 ========= The RFC states:(I mentioned earlier during the Duration discussion that time arithmetic is a one-dimensional real affine space. Such a space can be formalised as a set of points and a space of free vectors (and a way to add points and vectors together). Here, Durations provide the vectors and Instants provide the points.)An Time\Instant carries no timezone. It represents a unique point on the timeline of the universe.Why is there no explicit or implicit timezone attached? The RFC reads to me like there is an implicit timezone attached, namely the UTC timezone. Especially thetoIso8601DateTimeString()function which always returns the 'Z' timezone identifier seems to imply an implicit UTC timezone? I think I can answer that one. It's because for display purposes some consistent way of labelling Instants is required so that they can be displayed. Using an ISO8601 string just makes that label human-readable; the UTC timezone is not an intrinsic property of the Instant but of the labelling (nor are the labels themselves, for that matter). Instants would still be a thing and people would be able to say that two events occurred "at the same time" even if the International Meridian Conference had never happened.
I think *precision* should somehow be an explicit part of \Time\Instant class. How precise is the \Time\Instant?Well, then it's not an _instant_, is it? It's a combination of an instant ("now") and a duration ("and the subsequent sixty seconds").