Radar · Rust · Archive · Week 13 · Mar 24 – 30, 2025
jiff – a datetime library for Rust
Worth knowingecosystem
- What changed
- The crate of the week is jiff, a datetime library for Rust.
- Production impact
- The source does not say.
- Try it
- Add
jiff = "0.5"to your Cargo.toml and create aDateTimeinstance. - Source
- this-week-in-rust.org/blog/2025/03/26/this-week-in-rust-592/
Understand it, then run it
Run it now
// This program demonstrates how Rust’s standard library handles dates and times.
// It prints the current system time in seconds since the UNIX epoch.
// The crate of the week, `jiff`, would provide a richer API, but it is not part of the standard library.
use std::time::{SystemTime, UNIX_EPOCH};
fn main() {
// Get the current system time
let now = SystemTime::now();
// Convert to seconds since UNIX_EPOCH
let duration_since_epoch = now.duration_since(UNIX_EPOCH)
.expect("Time went backwards");
println!("Seconds since epoch: {}", duration_since_epoch.as_secs());
}
What it printed when we ran it on Rust 1.98.1 (edition 2024)
Seconds since epoch: 1790845398
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed