ffs_cli/utils/mod.rs
1use std::time::{SystemTime, UNIX_EPOCH};
2
3/// Returns the current Unix timestamp in seconds.
4///
5/// # Panics
6///
7/// Panics if the system time is before the Unix epoch.
8#[must_use]
9pub fn timestamp() -> u64 {
10 SystemTime::now()
11 .duration_since(UNIX_EPOCH)
12 .unwrap()
13 .as_secs()
14}