Convert UTC datetime to this timezone, handling DST properly
(&self, utc_dt: DateTime<Utc>)
| 60 | impl 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( |