Skip to content

Commit f42353c

Browse files
authored
Add a minimal README for zoneinfo_rs (#569)
1 parent 7ba5023 commit f42353c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

zoneinfo/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
# Zoneinfo_rs
3+
4+
**NOTE:** This crate is experimental and should be considered unstable.
5+
6+
`zoneinfo_rs` provides basic parsing and compilation of IANA's time zone database
7+
zoneinfo files.
8+
9+
```rust
10+
use std::path::Path;
11+
use zoneinfo_rs::{ZoneInfoData, ZoneInfoCompiler};
12+
// Below assumes we are in the parent directory of `tzdata`
13+
let zoneinfo_filepath = Path::new("./tzdata/");
14+
let parsed_data = ZoneInfoData::from_zoneinfo_directory(zoneinfo_filepath)?;
15+
let _compiled_data = ZoneInfoCompiler::new(parsed_data).build();
16+
```
17+
18+
## Extra notes
19+
20+
Currently, parsing only supports parsing of zoneinfo files and none of the preprocessing
21+
typically completed by `awk` scripts in tzdata.
22+
23+
It is recommended to still use the baseline awk script until preprocessing is supported.
24+
25+
## IANA tzdb repository
26+
27+
The latest version of the time zone database can be found [here](https://www.iana.org/time-zones)
28+

0 commit comments

Comments
 (0)