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
I'm trying to format a DateTime with a pattern (possibly invalid 2f for millis, 3f and 6f work), however it panics on to_string:
fn main() {
let dt = chrono::Local::now();
let formatted = dt.format("%H:%M:%S%.2f");
println!("{}", formatted.to_string());
}
result of a cargo run:
rust_test % cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.10s
Running `target/debug/rust_test`
thread 'main' panicked at 'a Display implementation returned an error unexpectedly: Error', /rustc/574b64a97f52162f965bc201e47f0af8279ca65d/library/alloc/src/string.rs:2537:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I'm trying to format a DateTime with a pattern (possibly invalid
2f
for millis,3f
and6f
work), however it panics onto_string
:result of a
cargo run
:cargo 1.68.0-nightly (2381cbdb4 2022-12-23)
chrono v0.4.23
The text was updated successfully, but these errors were encountered: