diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index e4bf92414..69519659a 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -730,9 +730,12 @@ func putReplicationOpts(ctx context.Context, sc string, objInfo ObjectInfo) (put putOpts.Mode = rmode } if retainDateStr, ok := lkMap.Lookup(xhttp.AmzObjectLockRetainUntilDate); ok { - rdate, err := time.Parse(time.RFC3339, retainDateStr) + rdate, err := time.Parse(iso8601TimeFormat, retainDateStr) if err != nil { - return putOpts, err + rdate, err = time.Parse(time.RFC3339, retainDateStr) + if err != nil { + return putOpts, err + } } putOpts.RetainUntilDate = rdate // set retention timestamp in opts diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go index 2dfb7b9f3..1c9993c36 100644 --- a/cmd/object-handlers.go +++ b/cmd/object-handlers.go @@ -2998,7 +2998,7 @@ func (api objectAPIHandlers) PutObjectRetentionHandler(w http.ResponseWriter, r } if objRetention.Mode.Valid() { oi.UserDefined[strings.ToLower(xhttp.AmzObjectLockMode)] = string(objRetention.Mode) - oi.UserDefined[strings.ToLower(xhttp.AmzObjectLockRetainUntilDate)] = objRetention.RetainUntilDate.UTC().Format(time.RFC3339) + oi.UserDefined[strings.ToLower(xhttp.AmzObjectLockRetainUntilDate)] = objRetention.RetainUntilDate.UTC().Format(iso8601TimeFormat) } else { oi.UserDefined[strings.ToLower(xhttp.AmzObjectLockMode)] = "" oi.UserDefined[strings.ToLower(xhttp.AmzObjectLockRetainUntilDate)] = ""