Skip to content
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

Dates not handled by Python 3.6 #1

Closed
jarvisms opened this issue Jul 3, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@jarvisms
Copy link
Owner

commented Jul 3, 2019

Python 3.6 strptime's %z doesn't understand timezone components separated by colons or "Z" as Python 3.7 does. i.e. +HHMM only, NOT Z or +HH:MM.
CentOS and RHEL uses Python3.6

@jarvisms jarvisms self-assigned this Jul 3, 2019

@jarvisms jarvisms added the bug label Jul 3, 2019

jarvisms added a commit that referenced this issue Jul 9, 2019

Fixing date problems in Python3.6
Fix for Issue #1 while also taking advantage of more efficient methods for 3.7+
@jarvisms

This comment has been minimized.

Copy link
Owner Author

commented Jul 9, 2019

Fixed in commit 3d9885b.
Python 3.7+ has a built in method datetime.fromisoformat that is fast and efficient so this is used where possible, although this needed adaption to handle "Z" timezones, otherwise a string manipulation method is used (simplified but based on 3.7's datetime.fromisoformat source code) as this is much faster than the existing and alternative datetime.strptime based approach which needed string manipulations to make it work anyway i.e. "Z" and ":" in timezone components.

@jarvisms jarvisms closed this Jul 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.