Skip to main content

resolve_offset

Function resolve_offset 

Source
pub fn resolve_offset(zone: &TzId, epoch_seconds: i64) -> i32
Expand description

Resolves a TzId’s real UTC offset (seconds east of UTC) at a given UTC instant – Offset’s value directly, or a Named zone’s real, DST-aware offset via chrono-tz’s embedded IANA database (the same zone name resolves to a different offset depending on which instant this is called with – there’s no single fixed “the” offset for a named zone, e.g. TCK’s Temporal1 [10] resolves Europe/Stockholm to +01:00 in October and +02:00 in July). Falls back to UTC (0) for a zone name that fails to parse – should never happen for a value MarsDB itself constructed (every Named zone is validated via parse_timezone_name before being stored), but this function can’t return an error, so degrade gracefully rather than panic on a hypothetical corrupt/foreign-written value.