torrust_index_backend/utils/clock.rs
1/// Returns the current timestamp in seconds.
2///
3/// # Panics
4///
5/// This function should never panic unless the current timestamp from the
6/// time library is negative, which should never happen.
7#[must_use]
8pub fn now() -> u64 {
9 u64::try_from(chrono::prelude::Utc::now().timestamp()).expect("timestamp should be positive")
10}