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
This commit is contained in:
Nick Craig-Wood 2021-09-04 12:47:18 +01:00
parent c821fbeddf
commit fc5d6c16b6

View file

@ -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 {