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
mktime adding an hour in April (naive struct)? #54311
Comments
Just starting to dabble in the world of time and datetime objects. I was converting an array of datetime objects to an array of floats via mktime to do some data analysis. I have ran into an issue where mktime seems to be adding an hour on April 6, 2003. Attached is an example script which I used to create the below output: Python version: (2, 6, 5, 'final', 0) |
It looks like you have just discovered the joys of daylight saving time. The problem with your example is that datetime(2003,4,6,2,58,17) is not a valid time in your timezone (most likely you are in the US). In the US, prior to 2007, the clocks moved 1 hour ahead at 2AM on the first Sunday in April. An thus 1:59 AM was followed by 3:00 AM and 2:58:17 never occurred. See the following link for detailed discussion of these issues: http://docs.python.org/dev/py3k/library/datetime.html#tzinfo-objects |
Wow. Should have caught that. Thanks for the response. Kevin |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: