I am trying to convert a string to a date using the Chrono library. I always get a BadFormat
or NotEnough
error:
extern crate chrono;
use chrono::prelude::*;
fn main() {
let dt1 = DateTime::parse_from_str(
"2017-08-30 18:34:06.638997932 UTC",
"%Y-%m-%d %H:%M:%S.%9f"
);
println!("{:?}", dt1);
}
I'm not sure what I am doing wrong.