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

Feature Request: string -> ZonedDateTime #6

Closed
JonathanAnderson opened this issue Sep 14, 2015 · 3 comments
Closed

Feature Request: string -> ZonedDateTime #6

JonathanAnderson opened this issue Sep 14, 2015 · 3 comments

Comments

@JonathanAnderson
Copy link

I am looking to parse a string into a ZonedDateTime

For example I would like to parse "2015-08-06T22:25:31+07:00" into a ZonedDateTime(DateTime(2015,08,06,22,25,31), FixedTimeZone("+07:00"))

I think a reasonable method would be to define a new dateformat so that ZonedDateTime("2015-08-06T22:25:31+07:00", some_dateformat) would work but I am still working to understand how 'timezones/io.jl' is working.

Still, I figured I would put up my request for now since I think it would be useful.

@iamed2
Copy link
Member

iamed2 commented Sep 14, 2015

I think this is the format you're looking for:

ZonedDateTime("2015-08-06T22:25:31+07:00", "yyyy-mm-ddTHH:MM:SSzzzz")

These things should be documented though. Perhaps at some point we can get a function like Python's dateutil's parse, which makes a best-guess parsing.

@omus
Copy link
Member

omus commented Sep 14, 2015

@iamed2 is correct. The ZonedDateTime parsing works using the same methods that DateTime provides. Eventually I'm planning on getting a more dynamic version of string parsing included. That may or may not be included in the TimeZones.jl package.

@JonathanAnderson
Copy link
Author

Since this works I'll close the issue =)

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

3 participants