[][src]Macro dia_time::local_time

macro_rules! local_time {
    () => { ... };
}

Gets local time

This unsafe-unstable macro requires libc crate. It returns std::io::Result.

Examples

let (year, month, day, hour, min, sec): (i32, i32, i32, i32, i32, i32) = unsafe {
    dia_time::local_time!().unwrap()
};
assert!(month >= 1 && month <= 12);
assert!(day >= 1 && day <= 31);
assert!(hour >= 0 && hour <= 23);
assert!(min >= 0 && min <= 59);
assert!(sec >= 0 && sec <= 59);