1 unstable release
0.1.0 | Oct 22, 2022 |
---|
#533 in Date and time
237 downloads per month
Used in 8 crates
(2 directly)
4KB
50 lines
clia-local-offset
Get current local timezone offset simplely.
This crate uses tz-rs
to obtain local timezone offset, and returns a time-rs
UtcOffset
.
Usage
use tracing_subscriber::fmt::time::OffsetTime;
// Local offset timezone init, and set time format.
let offset = clia_local_offset::current_local_offset()
.expect("Can not get local offset!");
let timer = OffsetTime::new(
offset,
format_description!(
"[year]-[month]-[day] [hour]:[minute]:[second].[subsecond digits:3]"
),
);
lib.rs
:
Get current local timezone offset simplely.
Dependencies
~1MB
~17K SLoC