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

Method convert_from_utc

graphlite/src/functions/temporal_functions.rs:62–73  ·  view source on GitHub ↗

Convert UTC datetime to this timezone, handling DST properly

(&self, utc_dt: DateTime<Utc>)

Source from the content-addressed store, hash-verified

60impl TimezoneInfo {
61 /// Convert UTC datetime to this timezone, handling DST properly
62 fn convert_from_utc(&self, utc_dt: DateTime<Utc>) -> Value {
63 match self {
64 TimezoneInfo::Named(tz) => {
65 let _local_dt = utc_dt.with_timezone(tz);
66 Value::DateTimeWithNamedTz(tz.to_string(), utc_dt)
67 }
68 TimezoneInfo::Fixed(offset) => {
69 let offset_dt = utc_dt.with_timezone(offset);
70 Value::DateTimeWithFixedOffset(offset_dt)
71 }
72 }
73 }
74
75 /// Perform DST-aware arithmetic by working in the local timezone
76 fn add_duration_dst_aware(

Callers 1

executeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected