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

strptime and time zones #2637

Closed
jesse99 opened this issue Jun 17, 2012 · 4 comments
Closed

strptime and time zones #2637

jesse99 opened this issue Jun 17, 2012 · 4 comments

Comments

@jesse99
Copy link
Contributor

jesse99 commented Jun 17, 2012

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.

@ghost ghost assigned erickt Jun 21, 2012
@yichoi
Copy link
Contributor

yichoi commented Jul 2, 2013

currently %z accepts like 0400 not like 04:00, however strptime still has same problem

strptime("1999-05-31T13:20:00-0500", "%FT%T%z")
-> Ok({tm_sec: 0, tm_min: 20, tm_hour: 13, tm_mday: 31, tm_mon: 4, tm_year: 99, tm_wday: 0, tm_yday: 0, tm_isdst: 0, tm_gmtoff: 0, tm_zone: ~"", tm_nsec: 0})

strptime("1999-05-31T13:20:00-0400", "%FT%T%z")
-> Ok({tm_sec: 0, tm_min: 20, tm_hour: 13, tm_mday: 31, tm_mon: 4, tm_year: 99, tm_wday: 0, tm_yday: 0, tm_isdst: 0, tm_gmtoff: 0, tm_zone: ~"", tm_nsec: 0})

@bblum
Copy link
Contributor

bblum commented Aug 19, 2013

this looks more like feature-complete than bwds-compat; renominating

@graydon
Copy link
Contributor

graydon commented Aug 22, 2013

just a bug, removing milestone/nomination.

@ghost
Copy link

ghost commented Nov 23, 2014

Filed in the time repo under time-rs/time#20. Closing.

@ghost ghost closed this as completed Nov 23, 2014
This issue was closed.
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

No branches or pull requests

5 participants