MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_timezone

Function parse_timezone

src/expr/src/scalar/func.rs:2137–2139  ·  view source on GitHub ↗

Parses a named timezone like `EST` or `America/New_York`, or a fixed-offset timezone like `-05:00`. The interpretation of fixed offsets depend on whether the POSIX or ISO 8601 standard is being used.

(tz: &str, spec: TimezoneSpec)

Source from the content-addressed store, hash-verified

2135/// The interpretation of fixed offsets depend on whether the POSIX or ISO 8601 standard is being
2136/// used.
2137pub(crate) fn parse_timezone(tz: &str, spec: TimezoneSpec) -> Result<Timezone, EvalError> {
2138 Timezone::parse(tz, spec).map_err(|_| EvalError::InvalidTimezone(tz.into()))
2139}
2140
2141/// Converts the time datum `b`, which is assumed to be in UTC, to the timezone that the interval datum `a` is assumed
2142/// to represent. The interval is not allowed to hold months, but there are no limits on the amount of seconds.

Callers 5

precompile_timezoneFunction · 0.85
reduce_call_variadicFunction · 0.85
timezone_time_variadicFunction · 0.85

Calls 1

parseFunction · 0.50

Tested by

no test coverage detected