diff --git a/changelog/unreleased/pull-2095 b/changelog/unreleased/pull-2095 new file mode 100644 index 000000000..e19b1efb5 --- /dev/null +++ b/changelog/unreleased/pull-2095 @@ -0,0 +1,7 @@ +Bugfix: consistently use local time for snapshots times + +By default snapshots created with restic backup were set to local time, +but when the --time flag was used the provided timestamp was parsed as +UTC. With this change all snapshots times are set to local time. + +https://github.com/restic/restic/pull/2095 diff --git a/cmd/restic/cmd_backup.go b/cmd/restic/cmd_backup.go index 614e00d6d..71f241401 100644 --- a/cmd/restic/cmd_backup.go +++ b/cmd/restic/cmd_backup.go @@ -377,7 +377,7 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina timeStamp := time.Now() if opts.TimeStamp != "" { - timeStamp, err = time.Parse(TimeFormat, opts.TimeStamp) + timeStamp, err = time.ParseInLocation(TimeFormat, opts.TimeStamp, time.Local) if err != nil { return errors.Fatalf("error in time option: %v\n", err) }