Parse this time `2025-01-30T17:57:52.495Z` with `chrono::DateTime`

The title should be enough.
I'm calling chrono::DateTime::parse_from_str("%FT%T%.3fZ","2025-01-30T17:57:52.495Z") and it's giving me ParseError(TooShort). It's frankly confusing.

For further clarification: This is not related to the type requiring a Timezone. The same exact error occurs with NaiveDateTime.

You have the arguments in the wrong position. The first argument is the date string, and the second one is the format: DateTime in chrono - Rust.

2 Likes

I just spent thirty minutes staring at it, atleast now I know I need to buy new glasses. Thanks!