Skip to content

EPOCH definition fails on win10 py3.6 #376

@ThomasLecocq

Description

@ThomasLecocq

Problem Description
Hi,
I'm (almost done) adapting our seismogram picking software built on traitsui+chaco to py3.

This line:

EPOCH = datetime.fromtimestamp(0.0)

fails on win10 x64 py3.6

The minimum value acceptable is 86400

Reproduction Steps:

In [1]: import datetime

In [2]: datetime.datetime.fromtimestamp(0)
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-2-ca3d263171b9> in <module>()
----> 1 datetime.datetime.fromtimestamp(0)

OSError: [Errno 22] Invalid argument

In [3]: datetime.datetime.fromtimestamp(86400)
Out[3]: datetime.datetime(1970, 1, 2, 1, 0)

Expected behavior:
I'd suspect that the desired behaviour is

epoch = datetime.datetime(1970,1,1)

but then, this might fail if another "0.0" is defined ?

OS, Python version:
Win10 x64 Py3.6 (Python 3.6.2 | Anaconda custom (64-bit))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions