Carl Mäsak wrote:
> Darren (>), commit-bot (>>):
>>> -=head2 Time
>>> +=head1 Current Time
>>>  +The epoch used in Perl 6 to represent time instants is the
>>> +International Atomic Time - TAI - which is independent of calendars,
>>> +timezones as well as leap seconds. Of course Perl can't go beyond the
>>> +machine to get a real TAI value, but it should perform any
>>> +platform-specific transformation to give you the most precise value it
>>> +can for the TAI.
>>> +
>>> + our Rat sub time()
>>> +
>>> +Returns a TAI epoch value for the current time.
>> Shouldn't the result type of time() be an "Instant" object (Instant and
>> Duration are defined in S02) rather than a "Rat"?
>
> I fear that the "Instant" from S02 is a fossil. "Instant" was renamed
> by Dave Rolsky to "DateTime" on 2009-02-19.
>
>  <http://www.mail-archive.com/perl6-all@perl.org/msg83161.html>

On the contrary.

In regards to being the temporal type that Perl's builtins like time() return, the earlier more limiting proposal DateTime is what was a fossil, and was superseded by Instant, which is a point on the TAI timeline, and is represented internally by a Rat.

The central nature was why plain "Instant" and "Duration" were declared and described in S02 rather than S32. By Larry.

Instead, the likes of DateTime/Date/Time, as described in terms of year/month/day/hour/minute/second/etc, is strictly an add-on, described in S32, for separate purposes.

Essentially, the core-most Instant/Duration are for things like timestamps where we mainly care about position of an event on a timeline and its relative distance from other events, such as an automatic log, and its also used by time(), etc.

In contrast, DateTime/Date/Time are mainly for temporal artifacts that are manually entered by users to describe something significant such as a meeting day or birthday or something, which are affected by calendar and DST etc. The TAI of time() could be imported into a DateTime etc object for user display on a localized basis.

These concepts of timestamp versus human date are very distinct things, and the former is very simple while the latter isn't, and should be kept distinct.

Daniel Ruoso wrote:
Em Qua, 2009-09-09 às 14:49 +0400, Richard Hainsworth escreveu:
Carl Mäsak wrote:
I fear that the "Instant" from S02 is a fossil. "Instant" was renamed
by Dave Rolsky to "DateTime" on 2009-02-19.
There was fairly extensive discussion. My recollection was that 'Instant' and 'Duration' were preferred. Since a TAI epoch value is the underlying metric, how about a 'TAI' as the type (in place of DateTime)?

One thing that needs to be clarified here is that DateTime provides
semantics that Instant doesn't. Instant is a TAI epoch value, DateTime
is a fully-qualified date and time specification according to some
specific Calendar.

Yes, absolutely. The two are very different things. And the TAI epoch thing is defined in S02 for core functions while DateTime is more auxiliary / in S32.

I'm comitting a new revision of the Temporal spec now that should make
this distinction even clearer...

-- Darren Duncan

Reply via email to