Skip to content

Commit

Permalink
Rollup merge of #93495 - solid-rs:fix-kmc-solid-rtc-month, r=yaahc
Browse files Browse the repository at this point in the history
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 authored Feb 4, 2022
2 parents 6f03bd0 + 175219a commit af2886e
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 af2886e

Please sign in to comment.