If you click on the "obsolete" note in the documentation, you will see that it points to the repositoryrust-lang/time . In fact, it was ported from the standard library to its own package.
If you add the dependency on the box timeas indicated in the documentation, this works:
extern crate time;
use std::time::duration::Duration;
fn main() {
let now = time::get_time();
println!("now: {}", now);
let later = now + Duration::minutes(5);
println!("later: {}", later);
}
source
share