From 0536e15bbf75a9cc91b212dd706a5433cfc573c3 Mon Sep 17 00:00:00 2001 From: Michael Eischer <9106997+MichaelEischer@users.noreply.github.com> Date: Sun, 14 Jun 2026 14:02:20 +0200 Subject: [PATCH] snapshots: show location name instead of current timezone (#21877) --- changelog/unreleased/pull-21876 | 8 ++++++++ cmd/restic/cmd_snapshots.go | 7 ++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 changelog/unreleased/pull-21876 diff --git a/changelog/unreleased/pull-21876 b/changelog/unreleased/pull-21876 new file mode 100644 index 000000000..ec8e2d8f1 --- /dev/null +++ b/changelog/unreleased/pull-21876 @@ -0,0 +1,8 @@ +Bugfix: Show timezone location in `snapshots` output + +Since restic 0.19.0, the `snapshots` command printed the current timezone when +listing snapshots. However, the timezone can change during the year, for example, +due to daylight saving time. Instead just print the name of the current location. + +https://github.com/restic/restic/pull/21876 +https://forum.restic.net/t/possible-bug-in-timezone-naming/10867 diff --git a/cmd/restic/cmd_snapshots.go b/cmd/restic/cmd_snapshots.go index 12fbc7bf6..cefe25cd6 100644 --- a/cmd/restic/cmd_snapshots.go +++ b/cmd/restic/cmd_snapshots.go @@ -246,11 +246,8 @@ func PrintSnapshots(stdout io.Writer, list data.Snapshots, reasons []data.KeepRe // Each snapshot can be registered in different timezones, // but we display them all in local timezone on this output. footer := fmt.Sprintf("%d snapshots", len(list)) - zoneName, _ := time.Now().Local().Zone() - if zoneName != "" { - footer = fmt.Sprintf("Timestamps shown in %s timezone\n%s", zoneName, footer) - } - tab.AddFooter(footer) + zoneName := time.Now().Local().Location().String() + tab.AddFooter(fmt.Sprintf("Timestamps shown in %s timezone\n%s", zoneName, footer)) if multiline { // print an additional blank line between snapshots