We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b61641a commit 7be77a6Copy full SHA for 7be77a6
1 file changed
src/main.rs
@@ -250,12 +250,12 @@ pub fn time_mod(
250
time_format: &str,
251
) -> Result<(), Box<dyn std::error::Error>> {
252
if e.symlink_metadata()?.modified().is_ok() {
253
- let mtime = FileTime::from_last_modification_time(&e.symlink_metadata().unwrap());
254
- let d = NaiveDateTime::from_timestamp(mtime.seconds() as i64, 0);
+ let timestamp = fs::symlink_metadata(e)?;
+ let naive = NaiveDateTime::from_timestamp(FileTime::from_last_modification_time(×tamp).seconds() as i64, 0);
255
+ let datetime: DateTime<Local> = DateTime::from_utc(naive, *Local::now().offset());
256
if !Cli::from_args().colors_on {
257
print!("{}", color::Fg(color::LightRed));
258
}
- let datetime = d;
259
print!("{} ", datetime.format(time_format));
260
261
Ok(())
0 commit comments