Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed May 18, 2024
1 parent 0ec2f19 commit ac763a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions suppaftp/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ impl File {
NaiveDateTime::parse_from_str(tm, "%Y%m%d%H%M%S")
.map(|dt| {
SystemTime::UNIX_EPOCH
.checked_add(Duration::from_secs(dt.timestamp() as u64))
.checked_add(Duration::from_secs(dt.and_utc().timestamp() as u64))
.unwrap_or(SystemTime::UNIX_EPOCH)
})
.map_err(|_| ParseError::InvalidDate)
Expand Down Expand Up @@ -474,7 +474,7 @@ impl File {
// Convert datetime to system time
let sys_time: SystemTime = SystemTime::UNIX_EPOCH;
Ok(sys_time
.checked_add(Duration::from_secs(datetime.timestamp() as u64))
.checked_add(Duration::from_secs(datetime.and_utc().timestamp() as u64))
.unwrap_or(SystemTime::UNIX_EPOCH))
}

Expand All @@ -483,7 +483,7 @@ impl File {
NaiveDateTime::parse_from_str(tm, "%d-%m-%y %I:%M%p")
.map(|dt| {
SystemTime::UNIX_EPOCH
.checked_add(Duration::from_secs(dt.timestamp() as u64))
.checked_add(Duration::from_secs(dt.and_utc().timestamp() as u64))
.unwrap_or(SystemTime::UNIX_EPOCH)
})
.map_err(|_| ParseError::InvalidDate)
Expand Down

0 comments on commit ac763a3

Please sign in to comment.