This was originally reported here: pola-rs/polars#17167
To reproduce:
[package]
name = "scratch"
version = "0.1.0"
edition = "2021"
[dependencies]
chrono = "0.4.38"
src/main.rs
use chrono::NaiveDateTime;
fn main() {
let result = NaiveDateTime::parse_from_str(
"2024-06-03 20:02:48.6800000",
"%Y-%m-%d %H:%M:%S%.6f0",
);
println!("{:?}", result);
let result = NaiveDateTime::parse_from_str(
"2024-06-03 20:02:48.680000",
"%Y-%m-%d %H:%M:%S%.6f",
);
println!("{:?}", result);
}
prints
Err(ParseError(TooShort))
Ok(2024-06-03T20:02:48.680)
This was originally reported here: pola-rs/polars#17167
To reproduce:
src/main.rsprints