MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / offset_seconds

Method offset_seconds

graphlite/src/functions/timezone_functions.rs:136–144  ·  view source on GitHub ↗

Get timezone offset in seconds for a given UTC datetime

(&self, utc_dt: &DateTime<Utc>)

Source from the content-addressed store, hash-verified

134
135 /// Get timezone offset in seconds for a given UTC datetime
136 fn offset_seconds(&self, utc_dt: &DateTime<Utc>) -> i32 {
137 match self {
138 TimezoneType::Named(tz) => {
139 let tz_dt = utc_dt.with_timezone(tz);
140 tz_dt.offset().fix().local_minus_utc()
141 }
142 TimezoneType::Fixed(offset) => offset.local_minus_utc(),
143 }
144 }
145}
146
147/// AT TIME ZONE operator: converts datetime to specified timezone

Callers 1

executeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected