1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 03:26:18 +00:00

touch: replace use of deprecated chrono functions

This commit is contained in:
Daniel Hofstetter 2024-03-06 18:16:49 +01:00
parent c45c00eed4
commit aad8f7d8b5
2 changed files with 3 additions and 3 deletions

View file

@ -32,7 +32,7 @@ fn set_file_times(at: &AtPath, path: &str, atime: FileTime, mtime: FileTime) {
fn str_to_filetime(format: &str, s: &str) -> FileTime {
let tm = chrono::NaiveDateTime::parse_from_str(s, format).unwrap();
FileTime::from_unix_time(tm.timestamp(), tm.timestamp_subsec_nanos())
FileTime::from_unix_time(tm.and_utc().timestamp(), tm.timestamp_subsec_nanos())
}
#[test]