| 887 | impl StructTimeData { |
| 888 | #[cfg(not(any(unix, windows)))] |
| 889 | fn new_inner( |
| 890 | vm: &VirtualMachine, |
| 891 | tm: NaiveDateTime, |
| 892 | isdst: i32, |
| 893 | gmtoff: i32, |
| 894 | zone: &str, |
| 895 | ) -> Self { |
| 896 | Self { |
| 897 | tm_year: vm.ctx.new_int(tm.year()).into(), |
| 898 | tm_mon: vm.ctx.new_int(tm.month()).into(), |
| 899 | tm_mday: vm.ctx.new_int(tm.day()).into(), |
| 900 | tm_hour: vm.ctx.new_int(tm.hour()).into(), |
| 901 | tm_min: vm.ctx.new_int(tm.minute()).into(), |
| 902 | tm_sec: vm.ctx.new_int(tm.second()).into(), |
| 903 | tm_wday: vm.ctx.new_int(tm.weekday().num_days_from_monday()).into(), |
| 904 | tm_yday: vm.ctx.new_int(tm.ordinal()).into(), |
| 905 | tm_isdst: vm.ctx.new_int(isdst).into(), |
| 906 | tm_zone: vm.ctx.new_str(zone).into(), |
| 907 | tm_gmtoff: vm.ctx.new_int(gmtoff).into(), |
| 908 | } |
| 909 | } |
| 910 | |
| 911 | /// Create struct_time for UTC (gmtime) |
| 912 | #[cfg(not(any(unix, windows)))] |