-
Notifications
You must be signed in to change notification settings - Fork 533
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
Convience method for converting from DateTime<FixedOffset> to UTC #169
Comments
The fact that However, we could probably implement either a Doing that depends a bit on the philosophical outlook of this trait: whether we want to implement a whole bunch of kind-of-trivial ergonomic methods or if we want to keep the API surface small. We're currently thinking about the tradeoffs of the two philosophies. |
Thanks I can understand wanting to keep the api simple I guess. However, speaking from my experience from Python I would expect other crates that wrap chrono to popup eventually and I am not sure that is desirable. The Python datetime library was difficult to work with and that lead to the "dateutil", "arrow", and "simple-date" wrapper libraries and probably more I don't know about. |
I've spent about 30 minutes trying to figure out how to correctly convert between I support making that conversion obvious.
|
If a convenience method (e.g. EDIT: oops, misread the original issue, sorry. This comment is kind of tangential / unrelated. |
I also have to google around a long time and lucked upon finding this issue. |
I'm going to close this issue. The original request has been addressed with #806 in that you can now call However, I'm definitely open to the idea that ergonomic issues still exist here! In order to address those, please open a new issue with some example code of where you're running into trouble/a conversion that seems to require more complex code than what you feel is necessary. |
Hi
Currently I am doing something like
let dt : DateTime = DateTime::parse_from_rfc3339("1970-01-01T00:00:00+00:00")?;
let dt_utc : DateTime = DateTime::::from_utc(dt.naive_utc(), UTC);
Is there any more convenient way todo this and vice versa ?
Thanks
The text was updated successfully, but these errors were encountered: