diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-02-04 18:42:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-04 18:42:14 +0100 |
| commit | af2886eef9cb27419ea7d8a451a1fc1cb33d5d8e (patch) | |
| tree | 63cd3e1871a28c49397cc756d212f9608759a608 /library/std/src/sys | |
| parent | 6f03bd09ff6ef6402b68b32485f0d25e7f6c0c01 (diff) | |
| parent | 175219ad0c7f75a055c167c4cca02d748ab64f31 (diff) | |
| download | rust-af2886eef9cb27419ea7d8a451a1fc1cb33d5d8e.tar.gz rust-af2886eef9cb27419ea7d8a451a1fc1cb33d5d8e.zip | |
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.
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/solid/time.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys/solid/time.rs b/library/std/src/sys/solid/time.rs index c67a736a903..ab988be2444 100644 --- a/library/std/src/sys/solid/time.rs +++ b/library/std/src/sys/solid/time.rs @@ -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, |
