datetime!() { /* proc-macro */ }
Expand description

Compile date and time as time::OffsetDateTime.

Example

const COMPILE_DATETIME: time::OffsetDateTime = compile_time::datetime!();

let year = COMPILE_DATETIME.year();
let month = COMPILE_DATETIME.month();
let day = COMPILE_DATETIME.day();
let hour = COMPILE_DATETIME.hour();
let minute = COMPILE_DATETIME.minute();
let second = COMPILE_DATETIME.second();
println!("Compiled at {hour:02}:{minute:02}:{second:02} on {month} {day}, {year}.");