[Numpy-discussion] Making datetime64 timezone naive
Marten van Kerkwijk
m.h.vankerkwijk at gmail.com
Tue Oct 13 20:08:14 EDT 2015
> > However, numpy datetime is optimized for compact storage and fast
> computation of absolute deltas (actual hours, minutes, seconds... not
> calendar units like "the next day" ).
> Except that ironically it actually can't compute absolute deltas
> accurately with one second resolution, because it does the POSIX time thing
> of pretending that all UTC days have the same number of seconds, even
> though this is not true (leap seconds).
> This isn't really relevant to anything else in this thread, except as a
> reminder of how freaky date/time handling is.
Maybe not directly relevant, but also very clearly why one should ideally
not use these at all! Perhaps even less relevant, but if you do need
absolute times (and thus work with UTC or TAI or GPS), have a look at
astropy's `Time` class. It does use two doubles, but with that maintains
"sub-nanosecond precision over times spanning the age of the universe" .
And it even converts to strings nicely!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion