-
-
Notifications
You must be signed in to change notification settings - Fork 283
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 back support for parsing strings with "GMT" offset #202
Comments
I'll actually be upgrading the cookie crate myself tomorrow — the time crate needs some prerequisites before moving forward with that. Sergio gave me the go-ahead earlier tonight. Just letting you know so there's no duplicated efforts 🙂 The approach I have taken in the conversion so far is to parse as a |
I actually already did most of the work, see rwf2/cookie-rs#134. |
Thanks! I will go through and do a thorough review of changes. I was also going to upgrade it to 2018, but that can be a separate PR. |
Closing in favor of #193, which will provide this and more. |
I'm trying to upgrade the cookie crate to time 0.2. As I understand it the relevant date format specification is https://tools.ietf.org/html/rfc2616#section-3.3.1. However, the current approach of not having
%Z
causes a bunch of pain for parsing these dates. Specifically,parse()
forOffsetDateTime
seems to returnInsufficientInformation
if I just try to parse with "GMT" in the format. So it seems I'd have to do a dance of (a) parsing aPrimitiveDateTime
, (b) callingto_offset()
on it, and (c) validating that it had the "GMT" or equivalent.I think the approach of actually having
%Z
support only forGMT
andUTC
was probably a better trade-off, especially since that would allow both a numeric offset as well as some of these abbrevations. Otherwise, perhapsOffsetDateTime
could maybe provide aparse_with_offset()
(or justparse_utc()
) method that allows a non-numeric offset literal in the format string while using the provided offset.The text was updated successfully, but these errors were encountered: