[Numpy-discussion] datetime64 1970 issue

Chris Barker - NOAA Federal chris.barker@noaa....
Thu Apr 18 10:37:55 CDT 2013


On Wed, Apr 17, 2013 at 11:27 PM, Joris Van den Bossche
<jorisvandenbossche@gmail.com> wrote:
>> Anyone tested this on Windows?
>
> On Windows 7, numpy 1.7.0 (Anaconda 1.4.0 64 bit), I don't even get a wrong
> answer, but an error:
>
> In [3]: np.datetime64('1969-12-31 00')
> Out[3]: numpy.datetime64('1969-12-31T00:00Z','h')
>
> In [4]: np.datetime64('1970-01-01 00')
> ---------------------------------------------------------------------------
> OSError                                   Traceback (most recent call last)
> <ipython-input-4-ebf323268a4e> in <module>()
> ----> 1 np.datetime64('1970-01-01 00')
>
> OSError: Failed to use 'mktime' to convert local time to UTC

OK -- so that confirms the issue is from using the system libs to do this.

though I'm surprised it fails on that date -- I would have expected it
to fail on the 1960 date -- unless there is code that bypasses the
system libs (Or modifies it some way) for pre-1970 dates.

>> We REALLY need to fix this!

There is a lot that we _could_ do to handle all tis well, but one
thing is clear to me -- poor timezone support is MUCH worse than no
timezone support!

I'll get that NEP up, but  I hope someone can get on this -- at least
before any next release.

-Chris



-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov


More information about the NumPy-Discussion mailing list