snapshots: show location name instead of current timezone (#21877)

This commit is contained in:
Michael Eischer authored and Michael Eischer committed 2026-06-23 19:11:19 +02:00
1 parent d6fd4ae26f
commit cb24c4f566
2 files changed
+10 -5

No files matched your search

+8
View File
@@ -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
+2 -5
View File
@@ -245,11 +245,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