Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatting fractional seconds besides 0/3/etc crashes #419

Open
donpdonp opened this issue May 5, 2020 · 0 comments
Open

formatting fractional seconds besides 0/3/etc crashes #419

donpdonp opened this issue May 5, 2020 · 0 comments

Comments

@donpdonp
Copy link

donpdonp commented May 5, 2020

chrono 0.4.11 rustc 1.42.0
now.format("%FT%T%.3f").to_string() => "2020-05-05T12:57:42.506"

I was looking for just 1 decimal place in the fractional seconds.

now.format("%FT%T%.1f").to_string() => 
 12: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  13: core::option::expect_none_failed
             at src/libcore/option.rs:1199
  14: core::result::Result<T,E>::expect
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/libcore/result.rs:991
  15: <T as alloc::string::ToString>::to_string
             at /rustc/b8cedc00407a4c56a3bda1ed605c6fc166655447/src/liballoc/s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants