Created
November 1, 2020 07:17
-
-
Save n0toose/b3d82f051c6f72c6146730e479639c0c to your computer and use it in GitHub Desktop.
Leap seconds in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://stackoverflow.com/questions/39686553/what-does-python-return-on-the-leap-second | |
import time | |
import datetime as dt | |
time.mktime(time.strptime('2016-06-30T23:59:59', "%Y-%m-%dT%H:%M:%S")) | |
time.mktime(time.strptime('2016-06-30T23:59:60', "%Y-%m-%dT%H:%M:%S")) | |
# datetime will fail | |
dt.datetime.strptime('2016-06-30T23:59:60', "%Y-%m-%dT%H:%M:%S") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment