| 917 | /// Create struct_time for local timezone (localtime) |
| 918 | #[cfg(not(any(unix, windows)))] |
| 919 | fn new_local(vm: &VirtualMachine, tm: NaiveDateTime, isdst: i32) -> Self { |
| 920 | let local_time = chrono::Local.from_local_datetime(&tm).unwrap(); |
| 921 | let offset_seconds = local_time.offset().local_minus_utc(); |
| 922 | let tz_abbr = local_time.format("%Z").to_string(); |
| 923 | Self::new_inner(vm, tm, isdst, offset_seconds, &tz_abbr) |
| 924 | } |
| 925 | |
| 926 | #[cfg(not(any(unix, windows)))] |
| 927 | fn to_date_time(&self, vm: &VirtualMachine) -> PyResult<NaiveDateTime> { |