#proc-macro #compilation #date-time

macro compile-time

Macros for getting compile time information

2 unstable releases

0.2.0 Jul 1, 2023
0.1.0 Jun 30, 2023

#1589 in Procedural macros

Download history 111960/week @ 2024-12-16 22184/week @ 2024-12-23 62021/week @ 2024-12-30 125247/week @ 2025-01-06 137620/week @ 2025-01-13 93767/week @ 2025-01-20 11406/week @ 2025-01-27 2708/week @ 2025-02-03 1447/week @ 2025-02-10 959/week @ 2025-02-17 1342/week @ 2025-02-24 1240/week @ 2025-03-03 1314/week @ 2025-03-10 793/week @ 2025-03-17 745/week @ 2025-03-24 747/week @ 2025-03-31

3,645 downloads per month
Used in 4 crates (2 directly)

MIT/Apache

14KB
181 lines

compile-time

Crates.io Documentation

This crate provides macros for getting compile time information.

You can get the compile time either as time::Date, time::Time, time::OffsetDateTime, string, or UNIX timestamp.

You can get the Rust compiler version either as semver::Version or string, and the individual version parts as integer literals or strings, respectively.

Example

let compile_datetime = compile_time::datetime_str!();
let rustc_version = compile_time::rustc_version_str!();

println!("Compiled using Rust {rustc_version} on {compile_datetime}.");

Dependencies

~1MB
~18K SLoC