Skip to main content

timestamp

Macro timestamp 

Source
timestamp!() { /* proc-macro */ }
Available on crate feature macros only.
Expand description

Construct a Timestamp with a statically known value.

The resulting expression can be used in const or static declarations.

The syntax accepted by this macro is a timestamp (as an integer or float) or the same as utc_datetime!.

assert_eq!(timestamp!(0), Timestamp::UNIX_EPOCH);
assert_eq!(timestamp!(1970-01-01 0:00), Timestamp::UNIX_EPOCH);
assert_eq!(timestamp!(1_234_567_890), Timestamp::new(1_234_567_890, 0)?);