Skip to content

Commit

Permalink
Rollup merge of rust-lang#93495 - solid-rs:fix-kmc-solid-rtc-month, r…
Browse files Browse the repository at this point in the history
…=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.
  • Loading branch information
matthiaskrgr committed Feb 4, 2022
2 parents 4e8fb74 + 175219a commit c3fa61c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sys/solid/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl SystemTime {
tm_min: rtc.tm_min,
tm_hour: rtc.tm_hour,
tm_mday: rtc.tm_mday,
tm_mon: rtc.tm_mon,
tm_mon: rtc.tm_mon - 1,
tm_year: rtc.tm_year,
tm_wday: rtc.tm_wday,
tm_yday: 0,
Expand Down

0 comments on commit c3fa61c

Please sign in to comment.