Rust

tz

Module

PHP's bundled timezone database and timelib's lookups over it (parse_tz.c, parse_posix.c, the abbreviation search of parse_date.re).

The data is PHP's own (data/timezonedb.bin, extracted from the timezonedb.h of the PHP version under test by data/timezonedb.py), so zone names, transitions and abbreviations are PHP's, not the system's.

Contents

use php_std::datetime::tz::Abbreviation;
Rust
pub struct Abbreviation

A row of timelib's abbreviation tables.

use php_std::datetime::tz::Offset;
Rust
pub struct Offset

What timelib_get_time_zone_info reports for an instant.

use php_std::datetime::tz::TzInfo;
Rust
pub struct TzInfo

A timezone identifier resolved against PHP's database.

The name is kept as it was requested (europe/paris stays lowercase), as timelib does.

Also implements Debug, PartialEq.
use php_std::datetime::tz::ZoneData;
Rust
pub struct ZoneData

The data of one zone (timelib_tzinfo without its name).

use php_std::datetime::tz::abbreviations;
Rust
pub fn abbreviations() -> impl Iterator<Item = Abbreviation>

The rows of timezonemap.h (DateTimeZone::listAbbreviations() data).

use php_std::datetime::tz::identifiers;
Rust
pub fn identifiers() -> impl Iterator<Item = &'static str>

timezone_identifiers_list() order: every identifier PHP knows, aliases included.

use php_std::datetime::tz::is_valid_id;
Rust
pub fn is_valid_id(name: &str) -> bool

timelib_timezone_id_is_valid.

use php_std::datetime::tz::strcasecmp;
Rust
pub fn strcasecmp(a: &[u8], b: &[u8]) -> i32

timelib_strcasecmp: ASCII case-insensitive, byte-wise, then by length.

use php_std::datetime::tz::version;
Rust
pub fn version() -> &'static str

timezone_version_get(): the version of the bundled database.