chrono icon indicating copy to clipboard operation
chrono copied to clipboard

Any way to parse string into a zoned datetime?

Open hydroper opened this issue 2 years ago • 1 comments

Is there a way to do this with chrono-tz?

<chrono::DateTime::<chrono_tz::Tz> as std::str::FromStr>::from_str(value).or(Err(RangeError))?

Any ideas about converting it back to a string?

(The above doesn't compile.)

... Hm, I'm not sure if this string conversion is necessary. I'm writing a temporal-like API (from the TC39 proposal), but not a 1-1 mapping and would these locale-unaware strings be useful in pratice? I guess not...


Well, I guess it can be useful to have these strings, yes! For passing them around when developing things...

hydroper avatar Aug 02 '23 20:08 hydroper

If anyone could help, I've posted here: https://users.rust-lang.org/t/help-with-chrono-and-chrono-tz/97917

hydroper avatar Aug 02 '23 21:08 hydroper