Skip to content

Commit

Permalink
Merge pull request #802 from versity/ben/utc_time
Browse files Browse the repository at this point in the history
fix: time locale utc in responses
  • Loading branch information
benmcclelland authored Sep 13, 2024
2 parents 080fd01 + 9dbfaee commit 53a7abf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions s3response/s3response.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (p Part) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
Alias: (*Alias)(&p),
}

aux.LastModified = p.LastModified.Format(RFC3339TimeFormat)
aux.LastModified = p.LastModified.UTC().Format(RFC3339TimeFormat)

return e.EncodeElement(aux, start)
}
Expand Down Expand Up @@ -87,7 +87,7 @@ func (r GetObjectAttributesResult) MarshalXML(e *xml.Encoder, start xml.StartEle
}

if r.LastModified != nil {
formattedTime := r.LastModified.Format(RFC3339TimeFormat)
formattedTime := r.LastModified.UTC().Format(RFC3339TimeFormat)
aux.LastModified = &formattedTime
}

Expand Down Expand Up @@ -174,7 +174,7 @@ func (o Object) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
}

if o.LastModified != nil {
formattedTime := o.LastModified.Format(RFC3339TimeFormat)
formattedTime := o.LastModified.UTC().Format(RFC3339TimeFormat)
aux.LastModified = &formattedTime
}

Expand All @@ -200,7 +200,7 @@ func (u Upload) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
Alias: (*Alias)(&u),
}

aux.Initiated = u.Initiated.Format(RFC3339TimeFormat)
aux.Initiated = u.Initiated.UTC().Format(RFC3339TimeFormat)

return e.EncodeElement(aux, start)
}
Expand Down Expand Up @@ -281,13 +281,13 @@ type ListAllMyBucketsEntry struct {
func (r ListAllMyBucketsEntry) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
type Alias ListAllMyBucketsEntry
aux := &struct {
CreationDate string `xml:"LastModified"`
CreationDate string `xml:"CreationDate"`
*Alias
}{
Alias: (*Alias)(&r),
}

aux.CreationDate = r.CreationDate.Format(RFC3339TimeFormat)
aux.CreationDate = r.CreationDate.UTC().Format(RFC3339TimeFormat)

return e.EncodeElement(aux, start)
}
Expand Down Expand Up @@ -316,7 +316,7 @@ func (r CopyObjectResult) MarshalXML(e *xml.Encoder, start xml.StartElement) err
Alias: (*Alias)(&r),
}

aux.LastModified = r.LastModified.Format(RFC3339TimeFormat)
aux.LastModified = r.LastModified.UTC().Format(RFC3339TimeFormat)

return e.EncodeElement(aux, start)
}
Expand Down

0 comments on commit 53a7abf

Please sign in to comment.