[Numpy-discussion] Proposal: add the timestamp64 type (Noam Yorav-Raphael)
Matti Picus
matti.picus at gmail.com
Thu Nov 12 11:40:22 EST 2020
On 11/12/20 6:04 PM, Stefano Miccoli wrote:
>
>
>> On 11 Nov 2020, at 18:00, numpy-discussion-request at python.org
>> <mailto:numpy-discussion-request at python.org> wrote:
>>
>> I propose to add a new type called "timestamp64". It will be a pure
>> timestamp, meaning that it represents a moment in time (as
>> seconds/ms/us/ns since the epoch), without any timezone information.
>
> Sorry, but I really don see the usefulness for another time stamping
> format based on POSIX time. Indeed POSIX time is based on a naive
> approximation of UTC and is ambiguous across leap seconds. Quoting
> from Wikipedia <https://en.wikipedia.org/wiki/Unix_time#Leap_seconds>
>
> ...
In a one-on-one discussion with Noam in a pre-community call (that, how
ironically, we had time for since we both messed up the meeting
time-zone change) we reached the conclusion that the request is to
clarify whether NumPy's datetime64 represents TAI time [0] or POSIX
time, with a preferecne for TAI time. The documentation mentions POSIX
time[1]. As Stefano points out, there is a couple of seconds difference
between POSIX (or Unix) time and TAI time. In practice numpy simply
stores a int64 value to represent the datetime64, and relies on others
to convert it. The leap-second might be getting lost in the conversions.
So it might make sense to clarify exactly how those conversions deal
with the leap-seconds and choose which one we mean when we use
datetime64. Noam please correct me if I am mistaken.
Matti
[0] https://en.wikipedia.org/wiki/International_Atomic_Time
[1]
https://numpy.org/doc/stable/reference/arrays.datetime.html#datetime-units
More information about the NumPy-Discussion
mailing list