-
Notifications
You must be signed in to change notification settings - Fork 553
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
Revert #806 #1318
Revert #806 #1318
Conversation
c19eb46
to
d9c3772
Compare
Codecov Report
@@ Coverage Diff @@
## main #1318 +/- ##
=======================================
Coverage 91.48% 91.48%
=======================================
Files 35 35
Lines 16860 16826 -34
=======================================
- Hits 15425 15394 -31
+ Misses 1435 1432 -3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is our most convenient way to convert from DateTime<FixedOffset>
to DateTime<Utc>
? Perhaps if we make that easy enough it compensates for this?
Should we deprecate these on 0.4.x?
I think
We can add a method similar to
There is no equivalent on 0.4.x. |
But it doesn't forget, right? It just folds it into the time? I was thinking it might be called |
I don't know, but kind of want to make it clear this is a non-reversible conversion. But well, so is From the API guidelines:
Sound like we should go with |
Ah yeah, I suppose |
#806 conveniently adds parsing methods to
DateTime<Utc>
. I don't believe it was fully realized at the time how much of a change this is going to be for users.All
parse_from_*
methods are going to need type annotations on 0.5. These are widely used methods. I think this makes the common use more annoying.Parsing to
DateTime<FixedOffset>
is what I consider the regular case. It is the type that best matches the format strings of RFC 3339, RFC 2822, ISO 8601, and any manual string that can be parsed as aDateTime
.Parsing to
DateTime<Utc>
folds the offset in the datetime value, essentially losing the offset information.In #1075 the discussion was to go in the opposite direction for 0.5: if we parse a value with fields that the target type can't hold, we should return an error.
So I would like to revert for two reasons: all the extra type annotations, and to make it an explicit choice for users to drop the offset information.
cc @mqudsi.