Consider the following
use chrono;
fn main() {
println!("{:?}", chrono::NaiveDate::parse_from_str("1978-01-12 01:00:23", "%Y-%m-%d %H:%M:%S"))
}
The string contains year-month-day-hour-minute-second, but chrono only parsed year-month-day. As expected, because I used NaiveDate, not NaiveDateTime.
But is there a way to tell (programmatically) that chrono "consumed" the entire format string?
Use
parse:Result:
If you want to use parsing using formats, what stops you from checking that format doesn't contain
%H,%Mor%S?