Where's Foundation.UTCClock?

SE-0329 mentions providing a UTCClock through Foundation:

Foundation will provide a type UTCClock that encompasses this behavior and use Date as the instant type. Additionally Foundation will provide conversions to and from Date to the other instant types in this proposal.

But this is still missing from beta 2. Will this API make it into the next release cycle?

4 Likes

We haven't forgotten about it; but to make it work right (by the designs that were put forward in the reviews) we need to take a bit of time to get all the ducks in a row. The particular part that is difficult is the leap second lookup database that we need to ensure properly is handled along with some of the overloads for Date itself.

13 Likes

This got me thinking whether we’re actually close to leap seconds being abolished at the 2023 World Radiocommunication Conference, allowing a complete implementation to simply hardcode existing leap seconds. Unfortunately, even though the 2015 conference resolved to revisit the topic in 2023, it looks like it is nowhere on the agenda or preparatory documents for next year…

2 Likes

If the future does not contain them then the problem becomes a bit simpler to solve, but the other part of the problem is that we need to represent the past too (which did contain them).

2 Likes

Fortunately it's a finite (and relatively short and easily compressed) list of past leap seconds.

2 Likes

Is there a timeline for this? We are trying to decide whether to use the new Duration types in our library and we would like to have integration with Foundation and Date so that the Duration properties are useful.

2 Likes

Are the any updates to report regarding UTCClock?

4 Likes