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:
parent
c821fbeddf
commit
fc5d6c16b6
1 changed files with 6 additions and 0 deletions
|
@ -14,6 +14,7 @@ import (
|
||||||
"os/user"
|
"os/user"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/rclone/rclone/cmd"
|
"github.com/rclone/rclone/cmd"
|
||||||
|
@ -503,6 +504,11 @@ func (f *FileInfo) Group() string {
|
||||||
return g.Name
|
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) {
|
func closeIO(path string, c io.Closer) {
|
||||||
err := c.Close()
|
err := c.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue