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

Add an RFC 3339 only mode #67

Closed
ExplodingCabbage opened this issue Jul 12, 2018 · 3 comments · Fixed by #70
Closed

Add an RFC 3339 only mode #67

ExplodingCabbage opened this issue Jul 12, 2018 · 3 comments · Fixed by #70

Comments

@ExplodingCabbage
Copy link
Contributor

ExplodingCabbage commented Jul 12, 2018

When parsing data that I know should be in RFC 3339, I'd like a strict mode that rejects non-RFC3339-compliant strings like 2018-07-12 or 2018-07-12T14Z or 2018-07-12T14:08:12.

(Mostly, I just want to be sure that I don't end up with a naive datetime when I expected a timezone-aware one, but validating that my data is actually RFC 3339 would be even better.)

It'd be nice to have a parse_rfc3339() function that is stricter than parse_datetime() and raises if it gets input that's valid ISO 8601 but not valid RFC 3339.

@movermeyer
Copy link
Collaborator

Thanks for the suggestion!

It does seem like this could be a useful feature.

This is a more limited version of #20, with a strict definition of what's accepted/rejected, so I personally find the idea more palatable.

I'd be willing to accept a pull request for it, if you're up for it.

@ExplodingCabbage
Copy link
Contributor Author

Sounds like I've got a task for the weekend!

@movermeyer
Copy link
Collaborator

Let me know if you have any trouble or questions. Check out CONTRIBUTING for some development tips & tricks.

ExplodingCabbage added a commit to ExplodingCabbage/ciso8601 that referenced this issue Jul 15, 2018
ExplodingCabbage added a commit to ExplodingCabbage/ciso8601 that referenced this issue Jul 15, 2018
ExplodingCabbage added a commit to ExplodingCabbage/ciso8601 that referenced this issue Jul 15, 2018
ExplodingCabbage added a commit to ExplodingCabbage/ciso8601 that referenced this issue Jul 15, 2018
movermeyer pushed a commit that referenced this issue Jul 23, 2018
* Add parse_rfc3339 function

Resolves #67

* Comma is not a valid RFC 3339 fractional seconds separator.

* Added section to README describing the new method.

* Added typing information for the new method.
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