build_epoch

Crates.iobuild_epoch
lib.rsbuild_epoch
version0.1.0
sourcesrc
created_at2015-07-24 12:25:44.101892
updated_at2016-07-05 06:03:13.54371
descriptionMacro for calculating the epoch at compile time
homepage
repositoryhttps://github.com/SkylerLipthay/build_epoch
max_upload_size
id2666
size3,018
Skyler (SkylerLipthay)

documentation

README

build_epoch

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).

#![feature(plugin)]
#![plugin(build_epoch)]

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.

Commit count: 5

cargo fmt