From fc5d6c16b62628d2004132dc05f632c8c58bec9b Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 4 Sep 2021 12:47:18 +0100 Subject: [PATCH] serve ftp: ensure modtime is passed as UTC always to fix timezone oddities See: https://forum.rclone.org/t/ftp-server-reports-file-timestamps-in-utc/26274 --- cmd/serve/ftp/ftp.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/serve/ftp/ftp.go b/cmd/serve/ftp/ftp.go index c3bcab6a9..843ee9ef4 100644 --- a/cmd/serve/ftp/ftp.go +++ b/cmd/serve/ftp/ftp.go @@ -14,6 +14,7 @@ import ( "os/user" "strconv" "sync" + "time" "github.com/pkg/errors" "github.com/rclone/rclone/cmd" @@ -503,6 +504,11 @@ func (f *FileInfo) Group() string { return g.Name } +// ModTime returns the time in UTC +func (f *FileInfo) ModTime() time.Time { + return f.FileInfo.ModTime().UTC() +} + func closeIO(path string, c io.Closer) { err := c.Close() if err != nil {