mirror of
https://github.com/rclone/rclone.git
synced 2026-01-03 00:53:43 +00:00
filter: fix timezone of --min-age/-max-age from UTC to local as documented
Before this change if the timezone was omitted in a --min-age/--max-age time specifier then rclone defaulted to a UTC timezone. This is documented as using the local timezone if the time zone specifier is omitted which is a much more useful default and this patch corrects the implementation to agree with the documentation. See: https://forum.rclone.org/t/problem-utc-windows-europe-1-summer-problem/29917
This commit is contained in:
@@ -80,7 +80,7 @@ var timeFormats = []string{
|
||||
func parseDurationDates(age string, epoch time.Time) (t time.Duration, err error) {
|
||||
var instant time.Time
|
||||
for _, timeFormat := range timeFormats {
|
||||
instant, err = time.Parse(timeFormat, age)
|
||||
instant, err = time.ParseInLocation(timeFormat, age, time.Local)
|
||||
if err == nil {
|
||||
return epoch.Sub(instant), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user