Fix error introduced in previous commit, where days in month was not
being updated while creating a DateTime struct from a u64 timestamp
This commit is contained in:
parent
af49f327ec
commit
68cccc840b
1 changed files with 3 additions and 1 deletions
|
@ -172,10 +172,12 @@ impl From<u64> for DateTime {
|
|||
}
|
||||
}
|
||||
let mut month = 1;
|
||||
let m_days = u64::from(days_in_month(month, year));
|
||||
let mut m_days = u64::from(days_in_month(month, year));
|
||||
while m_days <= days {
|
||||
println!("Days in month {month}: {m_days}");
|
||||
days -= m_days;
|
||||
month += 1;
|
||||
m_days = u64::from(days_in_month(month, year));
|
||||
}
|
||||
let seconds = ts % SECS_PER_DAY;
|
||||
let minutes = seconds / 60;
|
||||
|
|
Loading…
Add table
Reference in a new issue