PHP 8.6 gets Time\Duration, the first piece of a new date and time API. This RFC, from Tim Düsterhus and Derick Rethans, proposes the next piece: Time\Instant, a single point in time, plus a Time\Clock interface for asking what time it is now.
What it adds
An Instant is a moment on the timeline with nanosecond precision and no timezone. Combined with Duration, it covers "when did this happen" and "how long ago was that":
use Time\Clock\SystemClock; use Time\Instant; $now = (new SystemClock())->now(); $moonLanding = Instant::fromIso8601DateTimeString('1969-07-20T20:17:40Z'); echo $moonLanding->until($now)->seconds; // seconds since the moon landing
You can create instants from Unix timestamps (seconds or milliseconds) or ISO-8601 strings. If you already have a DateTime or DateTimeImmutable, its new toInstant() method gives you the same moment. The timezone is dropped and the microseconds are kept. You can move instants with add() and sub(), get the gap between two with until(), and compare them directly with <, > and <=>.
Why not an int or DateTimeImmutable?
An int from time() drops everything below a second, and nothing in the type says whether it holds seconds or milliseconds. DateTimeImmutable has the opposite problem: it carries a timezone and a full calendar, even when all you mean is "this moment". Instant is just the moment.
A clock you can swap out in tests
Code that calls time() or new DateTimeImmutable() is hard to test. The RFC adds a Time\Clock interface with one method, now(), so you can inject a clock and replace it with a fake:
final class FrozenClock implements Time\Clock { public function __construct(private Time\Instant $now) {} public function now(): Time\Instant { return $this->now; } }
For now PHP ships only SystemClock. The RFC lists more clocks, including ones for testing, as possible future additions.
What it deliberately leaves out
- Formatting and timezones. You can't print an
Instantas "Monday at 3pm", because that needs a timezone. A class that pairs an instant with a timezone is planned as a later step. - Leap seconds. They are ignored, as in almost every language.
- Measuring elapsed time. The system clock can jump, even backwards, so two readings can give a negative duration. A separate monotonic clock is future work.
What it means for your code
The RFC lists no breaking changes. Its three new names live in the Time\ namespace that was reserved for this API in 8.6, and DateTime and DateTimeImmutable each gain a toInstant() method. Time\Clock covers the same ground as PSR-20's ClockInterface, but returns an Instant rather than a DateTimeImmutable, so expect libraries to offer adapters between the two.
Where it stands
Tim Düsterhus opened the internals discussion on September 21, 2026. The RFC was updated on September 23 to say serialized instants will be portable. A September 29 revision added toInstant() and changed how the ISO-8601 output shows fractions of a second. Two questions are still open: whether to add more exception types, and exactly what range of dates an Instant supports.
It targets PHP 8.7, and no implementation is linked yet. With at least two weeks of discussion required, it can't go to a vote before early October. A vote would need a two-thirds majority.