1
mirror of https://github.com/rclone/rclone synced 2024-11-29 07:55:12 +01:00

webdav: parse time in alternate format for mydrive.ch - fixes #1952

This commit is contained in:
Nick Craig-Wood 2018-01-05 14:28:06 +00:00
parent b412c745a1
commit ef89f1f1a7

View File

@ -11,6 +11,8 @@ import (
const (
// Wed, 27 Sep 2017 14:28:34 GMT
timeFormat = time.RFC1123
// Fri, 05 Jan 2018 14:14:38 +0000 (as used by mydrive.ch)
timeFormatZ = time.RFC1123Z
)
// Multistatus contains responses returned from an HTTP 207 return code
@ -140,7 +142,10 @@ func (t *Time) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
}
newT, err := time.Parse(timeFormat, v)
if err != nil {
return err
newT, err = time.Parse(timeFormatZ, v)
if err != nil {
return err
}
}
*t = Time(newT)
return nil