Skip to content

strptime and time zones #20

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

Closed
ghost opened this issue Nov 23, 2014 · 1 comment · Fixed by #89
Closed

strptime and time zones #20

ghost opened this issue Nov 23, 2014 · 1 comment · Fixed by #89

Comments

@ghost
Copy link

ghost commented Nov 23, 2014

strptime is not handling time zones correctly. For example, if you use the format string "%FT%T%z" with ISO 8601 strings like
1999-05-31T13:20:00-04:00
and
1999-05-31T13:20:00-05:00
you get identical results back.

The code on line 510 seems seems to match the time zone offset but it only does something when the offset if zero.

Imported from rust-lang/rust#2637

@LorenVS
Copy link

LorenVS commented Apr 3, 2015

This seems to be the result of the %z parsing code in strptime only supporting timezones without the colon (i.e. 1999-05-31T13:20:00-0500). RFC-822 does include the colon in its specification. I can't seem. I also see some references (i.e. this stack overflow question http://stackoverflow.com/questions/26165659/python-timezone-z-directive-for-datetime-strptime-not-available) which use the format without the colon.

Should we support both of these or only one?

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 a pull request may close this issue.

2 participants