diff --git a/src/offset/local/tz_info/rule.rs b/src/offset/local/tz_info/rule.rs index 5e4568279..deebe0ffc 100644 --- a/src/offset/local/tz_info/rule.rs +++ b/src/offset/local/tz_info/rule.rs @@ -272,7 +272,7 @@ impl AlternateTime { } else if local_time >= dst_end_transition_end && local_time <= dst_end_transition_start { - Ok(crate::MappedLocalTime::Ambiguous(self.std, self.dst)) + Ok(crate::MappedLocalTime::Ambiguous(self.dst, self.std)) } else { Ok(crate::MappedLocalTime::Single(self.std)) } @@ -284,7 +284,7 @@ impl AlternateTime { } else if local_time >= dst_end_transition_end && local_time <= dst_end_transition_start { - Ok(crate::MappedLocalTime::Ambiguous(self.std, self.dst)) + Ok(crate::MappedLocalTime::Ambiguous(self.dst, self.std)) } else if local_time > dst_end_transition_end && local_time < dst_start_transition_start { @@ -309,7 +309,7 @@ impl AlternateTime { } else if local_time >= dst_start_transition_end && local_time <= dst_start_transition_start { - Ok(crate::MappedLocalTime::Ambiguous(self.dst, self.std)) + Ok(crate::MappedLocalTime::Ambiguous(self.std, self.dst)) } else if local_time > dst_start_transition_start && local_time < dst_end_transition_start { @@ -337,7 +337,7 @@ impl AlternateTime { } else if local_time >= dst_start_transition_end && local_time <= dst_start_transition_start { - Ok(crate::MappedLocalTime::Ambiguous(self.dst, self.std)) + Ok(crate::MappedLocalTime::Ambiguous(self.std, self.dst)) } else { Ok(crate::MappedLocalTime::Single(self.dst)) } diff --git a/src/offset/local/tz_info/timezone.rs b/src/offset/local/tz_info/timezone.rs index 268739c21..ed6ea9eab 100644 --- a/src/offset/local/tz_info/timezone.rs +++ b/src/offset/local/tz_info/timezone.rs @@ -238,7 +238,7 @@ impl<'a> TimeZoneRef<'a> { let local_leap_time = local_time; // if we have at least one transition, - // we must check _all_ of them, incase of any Overlapping (MappedLocalTime::Ambiguous) or Skipping (MappedLocalTime::None) transitions + // we must check _all_ of them, in case of any Overlapping (MappedLocalTime::Ambiguous) or Skipping (MappedLocalTime::None) transitions let offset_after_last = if !self.transitions.is_empty() { let mut prev = self.local_time_types[0]; @@ -259,7 +259,8 @@ impl<'a> TimeZoneRef<'a> { } else if local_leap_time >= transition_end && local_leap_time <= transition_start { - if prev.ut_offset < after_ltt.ut_offset { + // Going from local to UTC a bigger offset means an earlier time. + if prev.ut_offset > after_ltt.ut_offset { return Ok(crate::MappedLocalTime::Ambiguous(prev, after_ltt)); } else { return Ok(crate::MappedLocalTime::Ambiguous(after_ltt, prev)); @@ -271,7 +272,8 @@ impl<'a> TimeZoneRef<'a> { if local_leap_time < transition_start { return Ok(crate::MappedLocalTime::Single(prev)); } else if local_leap_time == transition_end { - if prev.ut_offset < after_ltt.ut_offset { + // Going from local to UTC a bigger offset means an earlier time. + if prev.ut_offset > after_ltt.ut_offset { return Ok(crate::MappedLocalTime::Ambiguous(prev, after_ltt)); } else { return Ok(crate::MappedLocalTime::Ambiguous(after_ltt, prev)); @@ -704,6 +706,7 @@ const SECONDS_PER_28_DAYS: i64 = SECONDS_PER_DAY * 28; mod tests { use super::super::Error; use super::{LeapSecond, LocalTimeType, TimeZone, TimeZoneName, Transition, TransitionRule}; + use crate::{NaiveDate, NaiveDateTime, NaiveTime}; #[test] fn test_no_dst() -> Result<(), Error> { @@ -933,6 +936,338 @@ mod tests { Ok(()) } + #[test] + #[allow(clippy::bool_assert_comparison)] + fn test_dst_backward_posix_tz() -> Result<(), Error> { + // Northern hemisphere DST (CET/CEST) + let tz = TimeZone::from_posix_tz("CET-1CEST,M3.5.0,M10.5.0/3")?; + let tz_ref = tz.as_ref(); + // For 2024 DST ends at 3:00 on October 27, moving back 1 hour. + let date = NaiveDateTime::new( + NaiveDate::from_ymd_opt(2024, 10, 27).unwrap(), + NaiveTime::from_hms_opt(2, 0, 0).unwrap(), + ); + let offsets = tz_ref.find_local_time_type_from_local(date.and_utc().timestamp(), 2024)?; + // The earlier time is the time still in DST. + assert_eq!(offsets.earliest().unwrap().is_dst, true); + assert_eq!(offsets.earliest().unwrap().ut_offset, 7200); + assert_eq!(offsets.earliest().unwrap().name.unwrap().as_bytes(), b"CEST"); + // The later time is the standard time. + assert_eq!(offsets.latest().unwrap().is_dst, false); + assert_eq!(offsets.latest().unwrap().ut_offset, 3600); + assert_eq!(offsets.latest().unwrap().name.unwrap().as_bytes(), b"CET"); + + // Southern Hemisphere (Chili) + let tz = TimeZone::from_posix_tz("<-04>4<-03>,M9.1.6/24,M4.1.6/24")?; + let tz_ref = tz.as_ref(); + // For 2024 DST ends at 0:00 on April 7, moving back 1 hour. + let date = NaiveDateTime::new( + NaiveDate::from_ymd_opt(2024, 4, 7).unwrap(), + NaiveTime::from_hms_opt(0, 0, 0).unwrap(), + ); + let offsets = tz_ref.find_local_time_type_from_local(date.and_utc().timestamp(), 2024)?; + // The earlier time is the time still in DST. + assert_eq!(offsets.earliest().unwrap().is_dst, true); + assert_eq!(offsets.earliest().unwrap().ut_offset, -10800); + assert_eq!(offsets.earliest().unwrap().name.unwrap().as_bytes(), b"-03"); + // The later time is the standard time. + assert_eq!(offsets.latest().unwrap().is_dst, false); + assert_eq!(offsets.latest().unwrap().ut_offset, -14400); + assert_eq!(offsets.latest().unwrap().name.unwrap().as_bytes(), b"-04"); + + // Reverse DST (Europe/Dublin) + let tz = TimeZone::from_posix_tz("IST-1GMT0,M10.5.0,M3.5.0/1")?; + let tz_ref = tz.as_ref(); + // For 2024 DST *starts* at 2:00 on October 27, moving back 1 hour. + let date = NaiveDateTime::new( + NaiveDate::from_ymd_opt(2024, 10, 27).unwrap(), + NaiveTime::from_hms_opt(2, 0, 0).unwrap(), + ); + let offsets = tz_ref.find_local_time_type_from_local(date.and_utc().timestamp(), 2024)?; + // The earlier time is the time still in DST. + assert_eq!(offsets.earliest().unwrap().is_dst, false); + assert_eq!(offsets.earliest().unwrap().ut_offset, 3600); + assert_eq!(offsets.earliest().unwrap().name.unwrap().as_bytes(), b"IST"); + // The later time is the standard time. + assert_eq!(offsets.latest().unwrap().is_dst, true); + assert_eq!(offsets.latest().unwrap().ut_offset, 0); + assert_eq!(offsets.latest().unwrap().name.unwrap().as_bytes(), b"GMT"); + + Ok(()) + } + + #[test] + #[allow(clippy::bool_assert_comparison)] + fn test_dst_backward_tzfile() -> Result<(), Error> { + // Northern hemisphere DST (CET/CEST) + let data: [u8; 604] = [ + 0x54, 0x5a, 0x69, 0x66, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x09, 0x65, 0x92, 0x00, 0x80, 0x66, 0x08, 0xb5, 0x90, 0x67, 0x1d, 0x90, 0x90, + 0x67, 0xe8, 0x97, 0x90, 0x68, 0xfd, 0x72, 0x90, 0x69, 0xc8, 0x79, 0x90, 0x6a, 0xdd, + 0x54, 0x90, 0x6b, 0xa8, 0x5b, 0x90, 0x6c, 0xc6, 0x71, 0x10, 0x6d, 0x88, 0x3d, 0x90, + 0x6e, 0xa6, 0x53, 0x10, 0x6f, 0x68, 0x1f, 0x90, 0x70, 0x86, 0x35, 0x10, 0x71, 0x51, + 0x3c, 0x10, 0x72, 0x66, 0x17, 0x10, 0x73, 0x31, 0x1e, 0x10, 0x74, 0x45, 0xf9, 0x10, + 0x75, 0x11, 0x00, 0x10, 0x76, 0x2f, 0x15, 0x90, 0x76, 0xf0, 0xe2, 0x10, 0x78, 0x0e, + 0xf7, 0x90, 0x78, 0xd0, 0xc4, 0x10, 0x79, 0xee, 0xd9, 0x90, 0x7a, 0xb0, 0xa6, 0x10, + 0x7b, 0xce, 0xbb, 0x90, 0x7c, 0x99, 0xc2, 0x90, 0x7d, 0xae, 0x9d, 0x90, 0x7e, 0x79, + 0xa4, 0x90, 0x7f, 0x8e, 0x7f, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, + 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, + 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x10, 0x00, 0x05, 0x00, + 0x00, 0x1c, 0x20, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0e, + 0x10, 0x00, 0x05, 0x43, 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x54, 0x5a, 0x69, 0x66, 0x32, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, + 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x65, 0x92, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x66, 0x08, 0xb5, 0x90, 0x00, 0x00, 0x00, 0x00, + 0x67, 0x1d, 0x90, 0x90, 0x00, 0x00, 0x00, 0x00, 0x67, 0xe8, 0x97, 0x90, 0x00, 0x00, + 0x00, 0x00, 0x68, 0xfd, 0x72, 0x90, 0x00, 0x00, 0x00, 0x00, 0x69, 0xc8, 0x79, 0x90, + 0x00, 0x00, 0x00, 0x00, 0x6a, 0xdd, 0x54, 0x90, 0x00, 0x00, 0x00, 0x00, 0x6b, 0xa8, + 0x5b, 0x90, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xc6, 0x71, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x6d, 0x88, 0x3d, 0x90, 0x00, 0x00, 0x00, 0x00, 0x6e, 0xa6, 0x53, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x6f, 0x68, 0x1f, 0x90, 0x00, 0x00, 0x00, 0x00, 0x70, 0x86, 0x35, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x71, 0x51, 0x3c, 0x10, 0x00, 0x00, 0x00, 0x00, 0x72, 0x66, + 0x17, 0x10, 0x00, 0x00, 0x00, 0x00, 0x73, 0x31, 0x1e, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x74, 0x45, 0xf9, 0x10, 0x00, 0x00, 0x00, 0x00, 0x75, 0x11, 0x00, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x76, 0x2f, 0x15, 0x90, 0x00, 0x00, 0x00, 0x00, 0x76, 0xf0, 0xe2, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x78, 0x0e, 0xf7, 0x90, 0x00, 0x00, 0x00, 0x00, 0x78, 0xd0, + 0xc4, 0x10, 0x00, 0x00, 0x00, 0x00, 0x79, 0xee, 0xd9, 0x90, 0x00, 0x00, 0x00, 0x00, + 0x7a, 0xb0, 0xa6, 0x10, 0x00, 0x00, 0x00, 0x00, 0x7b, 0xce, 0xbb, 0x90, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0x99, 0xc2, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7d, 0xae, 0x9d, 0x90, + 0x00, 0x00, 0x00, 0x00, 0x7e, 0x79, 0xa4, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x8e, + 0x7f, 0x90, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, + 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x10, 0x00, 0x05, 0x00, 0x00, 0x1c, 0x20, 0x01, + 0x00, 0x00, 0x00, 0x1c, 0x20, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x10, 0x00, 0x05, 0x43, + 0x45, 0x53, 0x54, 0x00, 0x43, 0x45, 0x54, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x0a, 0x43, 0x45, 0x54, 0x2d, 0x31, 0x43, 0x45, 0x53, 0x54, 0x2c, 0x4d, + 0x33, 0x2e, 0x35, 0x2e, 0x30, 0x2c, 0x4d, 0x31, 0x30, 0x2e, 0x35, 0x2e, 0x30, 0x2f, + 0x33, 0x0a, + ]; + + let tz = TimeZone::from_tz_data(&data)?; + let tz_ref = tz.as_ref(); + // For 2024 DST ends at 3:00 on October 27, moving back 1 hour. + let date = NaiveDateTime::new( + NaiveDate::from_ymd_opt(2024, 10, 27).unwrap(), + NaiveTime::from_hms_opt(2, 0, 0).unwrap(), + ); + let offsets = tz_ref.find_local_time_type_from_local(date.and_utc().timestamp(), 2024)?; + // The earlier time is the time still in DST. + assert_eq!(offsets.earliest().unwrap().is_dst, true); + assert_eq!(offsets.earliest().unwrap().ut_offset, 7200); + assert_eq!(offsets.earliest().unwrap().name.unwrap().as_bytes(), b"CEST"); + // The later time is the standard time. + assert_eq!(offsets.latest().unwrap().is_dst, false); + assert_eq!(offsets.latest().unwrap().ut_offset, 3600); + assert_eq!(offsets.latest().unwrap().name.unwrap().as_bytes(), b"CET"); + + // Southern Hemisphere (Chili) + let data: [u8; 2529] = [ + 0x54, 0x5a, 0x69, 0x66, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, + 0x00, 0x14, 0x80, 0x00, 0x00, 0x00, 0x8f, 0x30, 0x47, 0x45, 0x9b, 0x5c, 0xe5, 0x50, + 0x9f, 0x7c, 0xe2, 0xc5, 0xa1, 0x00, 0x71, 0xc0, 0xb0, 0x5e, 0x77, 0xc5, 0xb1, 0x77, + 0x3d, 0x40, 0xb2, 0x41, 0x00, 0xd0, 0xb3, 0x58, 0x70, 0xc0, 0xb4, 0x22, 0x34, 0x50, + 0xb5, 0x39, 0xa4, 0x40, 0xb6, 0x03, 0x67, 0xd0, 0xb7, 0x1a, 0xd7, 0xc0, 0xb7, 0xe4, + 0x9b, 0x50, 0xb8, 0xfd, 0x5c, 0xc0, 0xb9, 0xc7, 0x20, 0x50, 0xcc, 0x1c, 0x6e, 0x40, + 0xcc, 0x6c, 0xe7, 0xd0, 0xd3, 0xdc, 0x8f, 0xc0, 0xd4, 0x17, 0xd5, 0x30, 0xd5, 0x33, + 0x55, 0xc0, 0xd5, 0x76, 0x92, 0x40, 0xfd, 0xd1, 0x3c, 0x40, 0xfe, 0x92, 0xfa, 0xb0, + 0xff, 0xcc, 0xcd, 0xc0, 0x00, 0x72, 0xdc, 0xb0, 0x01, 0x75, 0x50, 0xc0, 0x02, 0x40, + 0x49, 0xb0, 0x03, 0x55, 0x32, 0xc0, 0x04, 0x20, 0x2b, 0xb0, 0x05, 0x3e, 0x4f, 0x40, + 0x06, 0x00, 0x0d, 0xb0, 0x07, 0x0b, 0xbc, 0x40, 0x07, 0xdf, 0xef, 0xb0, 0x08, 0xfe, + 0x13, 0x40, 0x09, 0xbf, 0xd1, 0xb0, 0x0a, 0xdd, 0xf5, 0x40, 0x0b, 0xa8, 0xee, 0x30, + 0x0c, 0xbd, 0xd7, 0x40, 0x0d, 0x88, 0xd0, 0x30, 0x0e, 0x9d, 0xb9, 0x40, 0x0f, 0x68, + 0xb2, 0x30, 0x10, 0x86, 0xd5, 0xc0, 0x11, 0x48, 0x94, 0x30, 0x12, 0x66, 0xb7, 0xc0, + 0x13, 0x28, 0x76, 0x30, 0x14, 0x46, 0x99, 0xc0, 0x15, 0x11, 0x92, 0xb0, 0x16, 0x26, + 0x7b, 0xc0, 0x16, 0xf1, 0x74, 0xb0, 0x18, 0x06, 0x5d, 0xc0, 0x18, 0xd1, 0x56, 0xb0, + 0x19, 0xe6, 0x3f, 0xc0, 0x1a, 0xb1, 0x38, 0xb0, 0x1b, 0xcf, 0x5c, 0x40, 0x1c, 0x91, + 0x1a, 0xb0, 0x1d, 0xaf, 0x3e, 0x40, 0x1e, 0x70, 0xfc, 0xb0, 0x1f, 0x8f, 0x20, 0x40, + 0x20, 0x7f, 0x03, 0x30, 0x21, 0x6f, 0x02, 0x40, 0x22, 0x39, 0xfb, 0x30, 0x23, 0x4e, + 0xe4, 0x40, 0x24, 0x19, 0xdd, 0x30, 0x25, 0x38, 0x00, 0xc0, 0x25, 0xf9, 0xbf, 0x30, + 0x26, 0xf2, 0xf8, 0xc0, 0x27, 0xd9, 0xa1, 0x30, 0x28, 0xf7, 0xc4, 0xc0, 0x29, 0xc2, + 0xbd, 0xb0, 0x2a, 0xd7, 0xa6, 0xc0, 0x2b, 0xa2, 0x9f, 0xb0, 0x2c, 0xb7, 0x88, 0xc0, + 0x2d, 0x82, 0x81, 0xb0, 0x2e, 0x97, 0x6a, 0xc0, 0x2f, 0x62, 0x63, 0xb0, 0x30, 0x80, + 0x87, 0x40, 0x31, 0x42, 0x45, 0xb0, 0x32, 0x60, 0x69, 0x40, 0x33, 0x3d, 0xd7, 0x30, + 0x34, 0x40, 0x4b, 0x40, 0x35, 0x0b, 0x44, 0x30, 0x36, 0x0d, 0xb8, 0x40, 0x37, 0x06, + 0xd5, 0xb0, 0x38, 0x00, 0x0f, 0x40, 0x38, 0xcb, 0x08, 0x30, 0x39, 0xe9, 0x2b, 0xc0, + 0x3a, 0xaa, 0xea, 0x30, 0x3b, 0xc9, 0x0d, 0xc0, 0x3c, 0x8a, 0xcc, 0x30, 0x3d, 0xa8, + 0xef, 0xc0, 0x3e, 0x6a, 0xae, 0x30, 0x3f, 0x88, 0xd1, 0xc0, 0x40, 0x53, 0xca, 0xb0, + 0x41, 0x68, 0xb3, 0xc0, 0x42, 0x33, 0xac, 0xb0, 0x43, 0x48, 0x95, 0xc0, 0x44, 0x13, + 0x8e, 0xb0, 0x45, 0x31, 0xb2, 0x40, 0x45, 0xf3, 0x70, 0xb0, 0x47, 0x11, 0x94, 0x40, + 0x47, 0xef, 0x02, 0x30, 0x48, 0xf1, 0x76, 0x40, 0x49, 0xbc, 0x6f, 0x30, 0x4a, 0xd1, + 0x58, 0x40, 0x4b, 0xb8, 0x00, 0xb0, 0x4c, 0xb1, 0x3a, 0x40, 0x4d, 0xc6, 0x07, 0x30, + 0x4e, 0x50, 0x82, 0xc0, 0x4f, 0x9c, 0xae, 0xb0, 0x50, 0x42, 0xd9, 0xc0, 0x51, 0x7c, + 0x90, 0xb0, 0x52, 0x2b, 0xf6, 0x40, 0x53, 0x5c, 0x72, 0xb0, 0x54, 0x0b, 0xd8, 0x40, + 0x57, 0x37, 0xe6, 0x30, 0x57, 0xaf, 0xec, 0xc0, 0x59, 0x17, 0xc8, 0x30, 0x59, 0x8f, + 0xce, 0xc0, 0x5a, 0xf7, 0xaa, 0x30, 0x5b, 0x6f, 0xb0, 0xc0, 0x5c, 0xa9, 0x67, 0xb0, + 0x5d, 0x74, 0x7c, 0xc0, 0x5e, 0x89, 0x49, 0xb0, 0x5f, 0x54, 0x5e, 0xc0, 0x60, 0x69, + 0x2b, 0xb0, 0x61, 0x34, 0x40, 0xc0, 0x62, 0x49, 0x0d, 0xb0, 0x63, 0x1d, 0x5d, 0x40, + 0x64, 0x28, 0xef, 0xb0, 0x64, 0xf4, 0x04, 0xc0, 0x66, 0x12, 0x0c, 0x30, 0x66, 0xdd, + 0x21, 0x40, 0x67, 0xf1, 0xee, 0x30, 0x68, 0xbd, 0x03, 0x40, 0x69, 0xd1, 0xd0, 0x30, + 0x6a, 0x9c, 0xe5, 0x40, 0x6b, 0xb1, 0xb2, 0x30, 0x6c, 0x7c, 0xc7, 0x40, 0x6d, 0x91, + 0x94, 0x30, 0x6e, 0x5c, 0xa9, 0x40, 0x6f, 0x7a, 0xb0, 0xb0, 0x70, 0x3c, 0x8b, 0x40, + 0x71, 0x5a, 0x92, 0xb0, 0x72, 0x25, 0xa7, 0xc0, 0x73, 0x3a, 0x74, 0xb0, 0x74, 0x05, + 0x89, 0xc0, 0x75, 0x1a, 0x56, 0xb0, 0x75, 0xe5, 0x6b, 0xc0, 0x76, 0xfa, 0x38, 0xb0, + 0x77, 0xc5, 0x4d, 0xc0, 0x78, 0xda, 0x1a, 0xb0, 0x79, 0xa5, 0x2f, 0xc0, 0x7a, 0xc3, + 0x37, 0x30, 0x7b, 0x85, 0x11, 0xc0, 0x7c, 0xa3, 0x19, 0x30, 0x7d, 0x6e, 0x2e, 0x40, + 0x7e, 0x82, 0xfb, 0x30, 0x7f, 0x4e, 0x10, 0x40, 0x7f, 0xff, 0xff, 0xff, 0x01, 0x02, + 0x01, 0x03, 0x01, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x03, + 0x02, 0x03, 0x05, 0x04, 0x02, 0x03, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x06, 0xff, 0xff, 0xbd, 0xbb, 0x00, 0x00, 0xff, 0xff, 0xbd, 0xbb, + 0x00, 0x04, 0xff, 0xff, 0xb9, 0xb0, 0x00, 0x08, 0xff, 0xff, 0xc7, 0xc0, 0x00, 0x0c, + 0xff, 0xff, 0xc7, 0xc0, 0x01, 0x0c, 0xff, 0xff, 0xd5, 0xd0, 0x01, 0x10, 0xff, 0xff, + 0xd5, 0xd0, 0x01, 0x10, 0xff, 0xff, 0xc7, 0xc0, 0x00, 0x0c, 0x4c, 0x4d, 0x54, 0x00, + 0x53, 0x4d, 0x54, 0x00, 0x2d, 0x30, 0x35, 0x00, 0x2d, 0x30, 0x34, 0x00, 0x2d, 0x30, + 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x01, 0x54, 0x5a, 0x69, 0x66, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x14, 0xff, 0xff, 0xff, 0xff, 0x69, 0x87, 0x1d, 0xc5, + 0xff, 0xff, 0xff, 0xff, 0x8f, 0x30, 0x47, 0x45, 0xff, 0xff, 0xff, 0xff, 0x9b, 0x5c, + 0xe5, 0x50, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x7c, 0xe2, 0xc5, 0xff, 0xff, 0xff, 0xff, + 0xa1, 0x00, 0x71, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x5e, 0x77, 0xc5, 0xff, 0xff, + 0xff, 0xff, 0xb1, 0x77, 0x3d, 0x40, 0xff, 0xff, 0xff, 0xff, 0xb2, 0x41, 0x00, 0xd0, + 0xff, 0xff, 0xff, 0xff, 0xb3, 0x58, 0x70, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xb4, 0x22, + 0x34, 0x50, 0xff, 0xff, 0xff, 0xff, 0xb5, 0x39, 0xa4, 0x40, 0xff, 0xff, 0xff, 0xff, + 0xb6, 0x03, 0x67, 0xd0, 0xff, 0xff, 0xff, 0xff, 0xb7, 0x1a, 0xd7, 0xc0, 0xff, 0xff, + 0xff, 0xff, 0xb7, 0xe4, 0x9b, 0x50, 0xff, 0xff, 0xff, 0xff, 0xb8, 0xfd, 0x5c, 0xc0, + 0xff, 0xff, 0xff, 0xff, 0xb9, 0xc7, 0x20, 0x50, 0xff, 0xff, 0xff, 0xff, 0xcc, 0x1c, + 0x6e, 0x40, 0xff, 0xff, 0xff, 0xff, 0xcc, 0x6c, 0xe7, 0xd0, 0xff, 0xff, 0xff, 0xff, + 0xd3, 0xdc, 0x8f, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xd4, 0x17, 0xd5, 0x30, 0xff, 0xff, + 0xff, 0xff, 0xd5, 0x33, 0x55, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xd5, 0x76, 0x92, 0x40, + 0xff, 0xff, 0xff, 0xff, 0xfd, 0xd1, 0x3c, 0x40, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x92, + 0xfa, 0xb0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcc, 0xcd, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x72, 0xdc, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x01, 0x75, 0x50, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x40, 0x49, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x03, 0x55, 0x32, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x20, 0x2b, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x05, 0x3e, + 0x4f, 0x40, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x0d, 0xb0, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x0b, 0xbc, 0x40, 0x00, 0x00, 0x00, 0x00, 0x07, 0xdf, 0xef, 0xb0, 0x00, 0x00, + 0x00, 0x00, 0x08, 0xfe, 0x13, 0x40, 0x00, 0x00, 0x00, 0x00, 0x09, 0xbf, 0xd1, 0xb0, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0xdd, 0xf5, 0x40, 0x00, 0x00, 0x00, 0x00, 0x0b, 0xa8, + 0xee, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xbd, 0xd7, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x0d, 0x88, 0xd0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x9d, 0xb9, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x0f, 0x68, 0xb2, 0x30, 0x00, 0x00, 0x00, 0x00, 0x10, 0x86, 0xd5, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x11, 0x48, 0x94, 0x30, 0x00, 0x00, 0x00, 0x00, 0x12, 0x66, + 0xb7, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x13, 0x28, 0x76, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x14, 0x46, 0x99, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x15, 0x11, 0x92, 0xb0, 0x00, 0x00, + 0x00, 0x00, 0x16, 0x26, 0x7b, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x16, 0xf1, 0x74, 0xb0, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x06, 0x5d, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x18, 0xd1, + 0x56, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x19, 0xe6, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x1a, 0xb1, 0x38, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x1b, 0xcf, 0x5c, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x1c, 0x91, 0x1a, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x1d, 0xaf, 0x3e, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x1e, 0x70, 0xfc, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x8f, + 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x20, 0x7f, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x21, 0x6f, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x22, 0x39, 0xfb, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x23, 0x4e, 0xe4, 0x40, 0x00, 0x00, 0x00, 0x00, 0x24, 0x19, 0xdd, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x25, 0x38, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x25, 0xf9, + 0xbf, 0x30, 0x00, 0x00, 0x00, 0x00, 0x26, 0xf2, 0xf8, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x27, 0xd9, 0xa1, 0x30, 0x00, 0x00, 0x00, 0x00, 0x28, 0xf7, 0xc4, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x29, 0xc2, 0xbd, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x2a, 0xd7, 0xa6, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x2b, 0xa2, 0x9f, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x2c, 0xb7, + 0x88, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x82, 0x81, 0xb0, 0x00, 0x00, 0x00, 0x00, + 0x2e, 0x97, 0x6a, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x62, 0x63, 0xb0, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x80, 0x87, 0x40, 0x00, 0x00, 0x00, 0x00, 0x31, 0x42, 0x45, 0xb0, + 0x00, 0x00, 0x00, 0x00, 0x32, 0x60, 0x69, 0x40, 0x00, 0x00, 0x00, 0x00, 0x33, 0x3d, + 0xd7, 0x30, 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, 0x4b, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x35, 0x0b, 0x44, 0x30, 0x00, 0x00, 0x00, 0x00, 0x36, 0x0d, 0xb8, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x37, 0x06, 0xd5, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x0f, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x38, 0xcb, 0x08, 0x30, 0x00, 0x00, 0x00, 0x00, 0x39, 0xe9, + 0x2b, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x3a, 0xaa, 0xea, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x3b, 0xc9, 0x0d, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x8a, 0xcc, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x3d, 0xa8, 0xef, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x6a, 0xae, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x88, 0xd1, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x53, + 0xca, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x41, 0x68, 0xb3, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x42, 0x33, 0xac, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x43, 0x48, 0x95, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x44, 0x13, 0x8e, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x45, 0x31, 0xb2, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x45, 0xf3, 0x70, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x47, 0x11, + 0x94, 0x40, 0x00, 0x00, 0x00, 0x00, 0x47, 0xef, 0x02, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x48, 0xf1, 0x76, 0x40, 0x00, 0x00, 0x00, 0x00, 0x49, 0xbc, 0x6f, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x4a, 0xd1, 0x58, 0x40, 0x00, 0x00, 0x00, 0x00, 0x4b, 0xb8, 0x00, 0xb0, + 0x00, 0x00, 0x00, 0x00, 0x4c, 0xb1, 0x3a, 0x40, 0x00, 0x00, 0x00, 0x00, 0x4d, 0xc6, + 0x07, 0x30, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x50, 0x82, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x4f, 0x9c, 0xae, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x50, 0x42, 0xd9, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x51, 0x7c, 0x90, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x52, 0x2b, 0xf6, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x53, 0x5c, 0x72, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x54, 0x0b, + 0xd8, 0x40, 0x00, 0x00, 0x00, 0x00, 0x57, 0x37, 0xe6, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x57, 0xaf, 0xec, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x59, 0x17, 0xc8, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x59, 0x8f, 0xce, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x5a, 0xf7, 0xaa, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x5b, 0x6f, 0xb0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x5c, 0xa9, + 0x67, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x5d, 0x74, 0x7c, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x5e, 0x89, 0x49, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x54, 0x5e, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x60, 0x69, 0x2b, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x61, 0x34, 0x40, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x62, 0x49, 0x0d, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x63, 0x1d, + 0x5d, 0x40, 0x00, 0x00, 0x00, 0x00, 0x64, 0x28, 0xef, 0xb0, 0x00, 0x00, 0x00, 0x00, + 0x64, 0xf4, 0x04, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x66, 0x12, 0x0c, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x66, 0xdd, 0x21, 0x40, 0x00, 0x00, 0x00, 0x00, 0x67, 0xf1, 0xee, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x68, 0xbd, 0x03, 0x40, 0x00, 0x00, 0x00, 0x00, 0x69, 0xd1, + 0xd0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x9c, 0xe5, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x6b, 0xb1, 0xb2, 0x30, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x7c, 0xc7, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x6d, 0x91, 0x94, 0x30, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x5c, 0xa9, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x6f, 0x7a, 0xb0, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x70, 0x3c, + 0x8b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x71, 0x5a, 0x92, 0xb0, 0x00, 0x00, 0x00, 0x00, + 0x72, 0x25, 0xa7, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x73, 0x3a, 0x74, 0xb0, 0x00, 0x00, + 0x00, 0x00, 0x74, 0x05, 0x89, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x75, 0x1a, 0x56, 0xb0, + 0x00, 0x00, 0x00, 0x00, 0x75, 0xe5, 0x6b, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x76, 0xfa, + 0x38, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x77, 0xc5, 0x4d, 0xc0, 0x00, 0x00, 0x00, 0x00, + 0x78, 0xda, 0x1a, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x79, 0xa5, 0x2f, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x7a, 0xc3, 0x37, 0x30, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x85, 0x11, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x7c, 0xa3, 0x19, 0x30, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x6e, + 0x2e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x82, 0xfb, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0x4e, 0x10, 0x40, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0x01, 0x02, + 0x01, 0x03, 0x01, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x03, + 0x02, 0x03, 0x05, 0x04, 0x02, 0x03, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, 0x06, 0x07, + 0x06, 0x07, 0x06, 0x06, 0xff, 0xff, 0xbd, 0xbb, 0x00, 0x00, 0xff, 0xff, 0xbd, 0xbb, + 0x00, 0x04, 0xff, 0xff, 0xb9, 0xb0, 0x00, 0x08, 0xff, 0xff, 0xc7, 0xc0, 0x00, 0x0c, + 0xff, 0xff, 0xc7, 0xc0, 0x01, 0x0c, 0xff, 0xff, 0xd5, 0xd0, 0x01, 0x10, 0xff, 0xff, + 0xd5, 0xd0, 0x01, 0x10, 0xff, 0xff, 0xc7, 0xc0, 0x00, 0x0c, 0x4c, 0x4d, 0x54, 0x00, + 0x53, 0x4d, 0x54, 0x00, 0x2d, 0x30, 0x35, 0x00, 0x2d, 0x30, 0x34, 0x00, 0x2d, 0x30, + 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x01, 0x0a, 0x3c, 0x2d, 0x30, 0x34, 0x3e, 0x34, 0x3c, 0x2d, 0x30, + 0x33, 0x3e, 0x2c, 0x4d, 0x39, 0x2e, 0x31, 0x2e, 0x36, 0x2f, 0x32, 0x34, 0x2c, 0x4d, + 0x34, 0x2e, 0x31, 0x2e, 0x36, 0x2f, 0x32, 0x34, 0x0a, + ]; + let tz = TimeZone::from_tz_data(&data)?; + let tz_ref = tz.as_ref(); + // For 2024 DST ends at 0:00 on April 7, moving back 1 hour. + let date = NaiveDateTime::new( + NaiveDate::from_ymd_opt(2024, 4, 7).unwrap(), + NaiveTime::from_hms_opt(0, 0, 0).unwrap(), + ); + let offsets = tz_ref.find_local_time_type_from_local(date.and_utc().timestamp(), 2024)?; + // The earlier time is the time still in DST. + assert_eq!(offsets.earliest().unwrap().is_dst, true); + assert_eq!(offsets.earliest().unwrap().ut_offset, -10800); + assert_eq!(offsets.earliest().unwrap().name.unwrap().as_bytes(), b"-03"); + // The later time is the standard time. + assert_eq!(offsets.latest().unwrap().is_dst, false); + assert_eq!(offsets.latest().unwrap().ut_offset, -14400); + assert_eq!(offsets.latest().unwrap().name.unwrap().as_bytes(), b"-04"); + + Ok(()) + } + #[test] fn test_leap_seconds() -> Result<(), Error> { let time_zone = TimeZone::new(