aboutsummaryrefslogtreecommitdiff
path: root/src/rtc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rtc.rs')
-rw-r--r--src/rtc.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rtc.rs b/src/rtc.rs
index d62da1f0a..afd46610e 100644
--- a/src/rtc.rs
+++ b/src/rtc.rs
@@ -102,7 +102,7 @@ pub fn convert_seconds_to_datetime(seconds: u32) -> RtcDateTime {
102 days -= days_in_year; 102 days -= days_in_year;
103 year += 1; 103 year += 1;
104 104
105 days_in_year = if year % 4 == 0 { 105 days_in_year = if year.is_multiple_of(4) {
106 DAYS_IN_A_YEAR + 1 106 DAYS_IN_A_YEAR + 1
107 } else { 107 } else {
108 DAYS_IN_A_YEAR 108 DAYS_IN_A_YEAR
@@ -110,7 +110,7 @@ pub fn convert_seconds_to_datetime(seconds: u32) -> RtcDateTime {
110 } 110 }
111 111
112 let mut days_per_month = [0u8, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; 112 let mut days_per_month = [0u8, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
113 if year % 4 == 0 { 113 if year.is_multiple_of(4) {
114 days_per_month[2] = 29; 114 days_per_month[2] = 29;
115 } 115 }
116 116