Skip to content

Commit 0afafaa

Browse files
committed
fix(cli): display file timestamps in local timezone instead of UTC
Fixes bounty issue #1253 The debug file command now displays modified and created timestamps in the user's local timezone rather than UTC, making the output more intuitive for users.
1 parent 7a104aa commit 0afafaa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cortex-cli/src/debug_cmd.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,11 @@ async fn run_file(args: FileArgs) -> Result<()> {
325325
let modified = meta
326326
.modified()
327327
.ok()
328-
.map(|t| chrono::DateTime::<chrono::Utc>::from(t).to_rfc3339());
328+
.map(|t| chrono::DateTime::<chrono::Local>::from(t).to_rfc3339());
329329
let created = meta
330330
.created()
331331
.ok()
332-
.map(|t| chrono::DateTime::<chrono::Utc>::from(t).to_rfc3339());
332+
.map(|t| chrono::DateTime::<chrono::Local>::from(t).to_rfc3339());
333333

334334
// Get symlink target if this is a symlink
335335
let symlink_target = if meta.file_type().is_symlink() {
@@ -1157,7 +1157,7 @@ async fn run_snapshot(args: SnapshotArgs) -> Result<()> {
11571157
let modified = meta
11581158
.modified()
11591159
.ok()
1160-
.map(|t| chrono::DateTime::<chrono::Utc>::from(t).to_rfc3339())
1160+
.map(|t| chrono::DateTime::<chrono::Local>::from(t).to_rfc3339())
11611161
.unwrap_or_else(|| "unknown".to_string());
11621162

11631163
snapshots.push(SnapshotInfo {

0 commit comments

Comments
 (0)