mirror of
https://github.com/octoleo/restic.git
synced 2025-01-23 23:28:32 +00:00
Merge pull request 2095 from plumbeo/parse-location
Use local time for user-provided time of backup
This commit is contained in:
commit
0de19cc87f
7
changelog/unreleased/pull-2095
Normal file
7
changelog/unreleased/pull-2095
Normal file
@ -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
|
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user