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

Parsing from string to DateTime - input is not enough for unique date and time #1575

Open
AustinHellerRepo opened this issue Apr 27, 2024 · 3 comments

Comments

@AustinHellerRepo
Copy link

When trying to parse the date/time "Sun, 28 Apr 2024 11:05:00 GMT" with "%a, %d %b %Y %H:%M:%S %Z" it claims that there is not enough information. Is there something wrong with my format or understanding of the process?

Rust playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=fa3d8c9d12107f73fa2eff695f98ab9e

@pitdicker
Copy link
Collaborator

This is an unfortunate limitation that is not fixed yet, see #38.
Do the comments in #1321, #1422 or #1542 help?

@AustinHellerRepo
Copy link
Author

Thanks for the links.
It looks like the issue is that it can be ambiguous, the timezone abbreviation. What are your thoughts on implementing the common timezones and producing a helpful error like "timezone not implemented"?

@pitdicker
Copy link
Collaborator

What are your thoughts on implementing the common timezones and producing a helpful error like "timezone not implemented"?

It is on my wishlist 😄. We would need to come up with some criteria for inclusion. Two criteria I think are reasonable is that the abbreviation should be used in the IANA time zone database and that it should be in use currently (not historical). Then the subjective part of what is common... but that may turn out not be too difficult to come up with.

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

2 participants