Expand description
§use-time-zone-id
Small IANA time zone identifier syntax primitives for RustUse.
§Example
use use_time_zone_id::{is_time_zone_id, parse_time_zone_id};
let zone = parse_time_zone_id("America/New_York").unwrap();
assert_eq!(zone.area(), "America");
assert_eq!(zone.location(), Some("New_York"));
assert!(is_time_zone_id("UTC"));§Scope
- Validate IANA-shaped time zone identifier syntax.
- Support identifiers like
UTC,America/New_York, andEurope/London. - Split valid identifiers into area and location components.
§Non-goals
- Time arithmetic.
- Daylight-saving calculations.
- Date/time conversion.
- Bundled tzdb data.
- Replacement for
time,chrono, ortz-rs.
§License
Licensed under either of the following, at your option:
- Apache License, Version 2.0
- MIT license
Structs§
- Time
Zone Id - A syntactically valid IANA-shaped time zone identifier.
Functions§
- is_
time_ zone_ id - Returns
truewhen the input is a syntactically valid IANA-shaped identifier. - parse_
time_ zone_ id - Parses a syntactically valid IANA-shaped time zone identifier.
- split_
time_ zone_ id - Splits a valid time zone identifier into owned segments.