forked from Deuxfleurs/garage
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 {
|
fn midnight_ts(date: NaiveDate) -> u64 {
|
||||||
date.and_hms_opt(0, 0, 0)
|
date.and_hms_opt(0, 0, 0)
|
||||||
.expect("midnight does not exist")
|
.expect("midnight does not exist")
|
||||||
|
.and_utc()
|
||||||
.timestamp_millis() as u64
|
.timestamp_millis() as u64
|
||||||
}
|
}
|
||||||
|
|
||||||
fn next_date(ts: u64) -> NaiveDate {
|
fn next_date(ts: u64) -> NaiveDate {
|
||||||
NaiveDateTime::from_timestamp_millis(ts as i64)
|
DateTime::from_timestamp_millis(ts as i64)
|
||||||
.expect("bad timestamp")
|
.expect("bad timestamp")
|
||||||
.date()
|
.date_naive()
|
||||||
.succ_opt()
|
|
||||||
.expect("no next day")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn today() -> NaiveDate {
|
fn today() -> NaiveDate {
|
||||||
|
|
Loading…
Add table
Reference in a new issue