diff options
Diffstat (limited to 'iterator.go')
| -rw-r--r-- | iterator.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/iterator.go b/iterator.go index c566f59..9938404 100644 --- a/iterator.go +++ b/iterator.go @@ -9,8 +9,18 @@ import ( "net/http" "strconv" "strings" + "time" ) +func parseSwiftLastModified(value string) (time.Time, error) { + // Swift listings traditionally omit the timezone, which is implicitly UTC. + // Some Swift-compatible APIs include a timezone, so try the value as-is first. + if parsed, err := time.Parse(time.RFC3339Nano, value); err == nil { + return parsed, nil + } + return time.Parse(time.RFC3339Nano, value+"Z") +} + // iteratorInterface allows iteratorBase to access public attributes of // ContainerIterator/ObjectIterator. type iteratorInterface interface { |
