File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -761,7 +761,7 @@ impl ZonedDateTime {
761761 // NOTE: The below should be safe as today_ns and tomorrow_ns should be at most 25 hours.
762762 // TODO: Tests for the below cast.
763763 // 10. Return 𝔽(TotalTimeDuration(diff, hour)).
764- Ok ( diff. divide ( 60_000_000_000 ) as u8 )
764+ Ok ( diff. divide ( 3_600_000_000_000 ) as u8 )
765765 }
766766}
767767
@@ -1643,6 +1643,21 @@ mod tests {
16431643 assert ! ( result. is_ok( ) ) ;
16441644 }
16451645
1646+ #[ test]
1647+ fn zdt_hours_in_day ( ) {
1648+ let provider = & FsTzdbProvider :: default ( ) ;
1649+ let zdt_str = "2025-07-04T12:00[UTC][u-ca=iso8601]" ;
1650+ let result = ZonedDateTime :: from_str_with_provider (
1651+ zdt_str,
1652+ Disambiguation :: Compatible ,
1653+ OffsetDisambiguation :: Reject ,
1654+ provider,
1655+ )
1656+ . unwrap ( ) ;
1657+
1658+ assert_eq ! ( result. hours_in_day_with_provider( provider) . unwrap( ) , 24 )
1659+ }
1660+
16461661 #[ test]
16471662 // https://github.com/tc39/test262/blob/d9b10790bc4bb5b3e1aa895f11cbd2d31a5ec743/test/intl402/Temporal/ZonedDateTime/from/dst-skipped-cross-midnight.js
16481663 fn dst_skipped_cross_midnight ( ) {
You can’t perform that action at this time.
0 commit comments