#macro #epoch #build

nightly build_epoch

Macro for calculating the epoch at compile time

2 unstable releases

Uses old Rust 2015

0.1.0 Jul 5, 2016
0.0.1 Jul 24, 2015

#587 in Procedural macros

MIT license



A simple Rust compiler plugin macro for generating an i64 specifying, in seconds, the time that the target crate was built in relation to epoch (1970-01-01T00:00:00Z).


fn main() {
    // At the time of writing, this prints "1437740236":
    println!("{}", build_epoch!());

The static value of build_epoch!() is determined when the compiler expands its first occurrence.