mirror of
https://github.com/rclone/rclone.git
synced 2025-01-11 08:49:37 +01:00
Make lsl output times in localtime and fix tests - fixes #141
This commit is contained in:
parent
e9c915e6fe
commit
5f20ae707d
@ -651,7 +651,7 @@ func ListLong(f Fs, w io.Writer) error {
|
|||||||
Stats.Checking(o)
|
Stats.Checking(o)
|
||||||
modTime := o.ModTime()
|
modTime := o.ModTime()
|
||||||
Stats.DoneChecking(o)
|
Stats.DoneChecking(o)
|
||||||
syncFprintf(w, "%9d %s %s\n", o.Size(), modTime.Format("2006-01-02 15:04:05.000000000"), o.Remote())
|
syncFprintf(w, "%9d %s %s\n", o.Size(), modTime.Local().Format("2006-01-02 15:04:05.000000000"), o.Remote())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,8 +485,9 @@ func TestLsLong(t *testing.T) {
|
|||||||
|
|
||||||
timeFormat := "2006-01-02 15:04:05.000000000"
|
timeFormat := "2006-01-02 15:04:05.000000000"
|
||||||
precision := fremote.Precision()
|
precision := fremote.Precision()
|
||||||
|
location := time.Now().Location()
|
||||||
checkTime := func(m, filename string, expected time.Time) {
|
checkTime := func(m, filename string, expected time.Time) {
|
||||||
modTime, err := time.Parse(timeFormat, m)
|
modTime, err := time.ParseInLocation(timeFormat, m, location) // parse as localtime
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Error parsing %q: %v", m, err)
|
t.Errorf("Error parsing %q: %v", m, err)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user