Why time is not part of the standard library?


#1

time crate which now lives in crates.io seems to be so fundamental and widely used so I’m wondering why it is not part of the standard Rust library?


#2

Because it’s hard to get right and there wasn’t going to be enough time to stabilize it. I’m personally a fan of letting these kinds of things mature externally. You really don’t want to end up with a standard library that has poor date/time support because you’ve committed to supporting it for a long time.


#3

It is widely used because it was previously in the standard library and so users of that just migrated directly to the crates.io version, and, I believe, for a while it was the only crate that provided that time functionality (there’s now chrono too).

It isn’t part of the standard library because it isn’t good enough for us to stabilise it “forever” by including it in the 1.0 release.

Being on crates.io gives much more flexibility due to being independent of the main distribution, so that we can update it independently of the compiler. A user should be able to go from Rust 1.0 to Rust 1.1 without having to change which version of time they’re using, in particular, they won’t have to adapt for any breaking changes that occurred in the API of time.