Skip to content

Use time.time() to obtain unix timestamp #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2020
Merged

Use time.time() to obtain unix timestamp #27

merged 1 commit into from
Apr 14, 2020

Conversation

biochimia
Copy link
Contributor

datetime.utcnow() returns an instance with no timezone information, and calling timestamp() on it applies a local to UTC conversion again. time.time() returns a unix timestamp directly, so there's no need to deal with UTC or timezone offsets.

datetime.utcnow() returns an instance with no timezone information, and calling timestamp() on it applies a local to UTC conversion again. time.time() returns a unix timestamp directly, so there's no need to deal with UTC or timezone offsets.
@timvink
Copy link
Owner

timvink commented Apr 14, 2020

More elegant indeed, thanks!

As it's a very minor tweak I will include it in the next release, which is not planned yet.

@timvink timvink merged commit a5a6639 into timvink:master Apr 14, 2020
@biochimia biochimia deleted the patch-3 branch April 14, 2020 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants