What returns the python time and datetime in the second jump?
What will I get when we are at 23: 59: 60.5 if I call:
time.time()datetime.datetime.utcnow()datetime.datetime.now(pytz.utc)
Also, is there any difference between py2.7 and py3?
Why is this confusing (at least for me):
From datetime docs, I see:
Unlike the time module, the datetime module does not support jump seconds.
In time docs, I see that there is βsupportβ for seconds of jump when parsing with strptime . But there are no comments about time.time() .
I see that using time , I get:
>>> time.mktime(time.strptime('2016-06-30T23:59:59', "%Y-%m-%dT%H:%M:%S")) 1467327599.0 >>> time.mktime(time.strptime('2016-06-30T23:59:60', "%Y-%m-%dT%H:%M:%S")) 1467327600.0 >>> time.mktime(time.strptime('2016-07-01T00:00:00', "%Y-%m-%dT%H:%M:%S")) 1467327600.0
And datetime just explodes:
>>> dt.datetime.strptime('2016-06-30T23:59:60', "%Y-%m-%dT%H:%M:%S") Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: second must be in 0..59
Then what will I get at this exact time (in the middle of a second of a jump)?
I read about rubber times, clock slowdowns, repeating seconds and all crazy ideas, but what should I expect in python?
Note. If you are wondering if I have anything better to do this, the second jump is coming !!!!