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

Function timezone_time

src/expr/src/scalar/func/impls/time.rs:158–164  ·  view source on GitHub ↗

Converts the time `t`, which is assumed to be in UTC, to the timezone `tz`. For example, `EST` and `17:39:14` would return `12:39:14`.

(tz: Timezone, t: NaiveTime, wall_time: &NaiveDateTime)

Source from the content-addressed store, hash-verified

156/// Converts the time `t`, which is assumed to be in UTC, to the timezone `tz`.
157/// For example, `EST` and `17:39:14` would return `12:39:14`.
158pub fn timezone_time(tz: Timezone, t: NaiveTime, wall_time: &NaiveDateTime) -> NaiveTime {
159 let offset = match tz {
160 Timezone::FixedOffset(offset) => offset,
161 Timezone::Tz(tz) => tz.offset_from_utc_datetime(wall_time).fix(),
162 };
163 t + offset
164}
165
166#[derive(
167 Ord,

Callers 2

timezone_time_variadicFunction · 0.85
callMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected