Function android_tzdata::find_tz_data
source · pub fn find_tz_data(tz_name: impl AsRef<str>) -> Result<Vec<u8>, Error>
Expand description
Tries to locate the tzdata
file, parse it, and return the entry for the
requested time zone.
Errors
Returns an std::io::Error if the tzdata
file cannot be found and parsed, or
if it does not contain the requested timezone entry.
Example
let tz_data = find_tz_data("Europe/Kiev")?;
// Check it's version 2 of the [Time Zone Information Format](https://www.ietf.org/archive/id/draft-murchison-rfc8536bis-02.html).
assert!(tz_data.starts_with(b"TZif2"));