Skip to content

Commit af2886e

Browse files
authored
Rollup merge of #93495 - solid-rs:fix-kmc-solid-rtc-month, r=yaahc
kmc-solid: Fix off-by-one error in `SystemTime::now` Fixes a miscalculation of `SystemTime` on the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets. Unlike the identically-named libc counterpart `tm::tm_mon`, `SOLID_RTC_TIME::tm_mon` contains a 1-based month number.
2 parents 6f03bd0 + 175219a commit af2886e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/sys/solid/time.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl SystemTime {
2121
tm_min: rtc.tm_min,
2222
tm_hour: rtc.tm_hour,
2323
tm_mday: rtc.tm_mday,
24-
tm_mon: rtc.tm_mon,
24+
tm_mon: rtc.tm_mon - 1,
2525
tm_year: rtc.tm_year,
2626
tm_wday: rtc.tm_wday,
2727
tm_yday: 0,

0 commit comments

Comments
 (0)