Fix (Naive)DateTime warning on UTC conversion
This commit is contained in:
parent
514c093501
commit
babdb7bc2c
1 changed files with 3 additions and 4 deletions
|
@ -388,15 +388,14 @@ fn check_size_filter(version_data: &ObjectVersionData, filter: &LifecycleFilter)
|
|||
fn midnight_ts(date: NaiveDate) -> u64 {
|
||||
date.and_hms_opt(0, 0, 0)
|
||||
.expect("midnight does not exist")
|
||||
.and_utc()
|
||||
.timestamp_millis() as u64
|
||||
}
|
||||
|
||||
fn next_date(ts: u64) -> NaiveDate {
|
||||
NaiveDateTime::from_timestamp_millis(ts as i64)
|
||||
DateTime::from_timestamp_millis(ts as i64)
|
||||
.expect("bad timestamp")
|
||||
.date()
|
||||
.succ_opt()
|
||||
.expect("no next day")
|
||||
.date_naive()
|
||||
}
|
||||
|
||||
fn today() -> NaiveDate {
|
||||
|
|
Loading…
Reference in a new issue