You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without knowing the Chrono internal I think DateTime::parse_from_str("1/1/06 0:00", "%D %H:%M").unwrap();
should just work in cases like this maybe assume UTC
This is not because of the single digit. This is rather the fact that DateTime<FixedOffset> (which is the return type of DateTime::parse_from_str) always requires time zones so you need some offset information to get the full DateTime<FixedOffset>.
There are generally two different ways to resolve the problem. One is, as described above, to use the explicit offset in the input:
Hi as a test I am trying to parse a date time in the format
"1/1/06 0:00"
month/day/year time
The single digits are causing issues I think.
what is the format for parsing this ?
I have tried lots of versions using
https://docs.rs/chrono/0.3.1/chrono/format/strftime/index.html
now but can't work it out
DateTime::parse_from_str("1/1/06 0:00", "%D %k:%M").unwrap();
Thanks
The text was updated successfully, but these errors were encountered: