Skip to content

Commit

Permalink
Get Epoch date by setting it verbosely
Browse files Browse the repository at this point in the history
Hopefully fixes OSError on Windows
  • Loading branch information
Amos Vryhof authored Oct 25, 2018
1 parent 5502774 commit 3b2cb70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ambient_api/ambientapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def convert_datetime(datetime_object):
posix_timestamp = datetime_object.timestamp()

except AttributeError:
epoch = datetime.datetime.fromtimestamp(0)
epoch = datetime.datetime(year=1969, month=12, day=31, hour=19, minute=0, second=0)
posix_timestamp = (datetime_object - epoch).total_seconds()

return int(posix_timestamp * 1000.0)
Expand Down

1 comment on commit 3b2cb70

@avryhof
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible fix for Issue #2

Please sign in to comment.