Skip to content

Commit

Permalink
Use RFC3339 format for parsing dates (#2744)
Browse files Browse the repository at this point in the history
  • Loading branch information
amalthundiyil authored Apr 19, 2022
1 parent 6aa5ea4 commit 628915c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions changelog/unreleased/rfc3339-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Use RFC3339 for parsing dates

We have used the RFC3339 format for parsing dates to be consistent with oC Web.

https://github.com/cs3org/reva/issues/2322
https://github.com/cs3org/reva/pull/2744
2 changes: 1 addition & 1 deletion internal/http/services/owncloud/ocs/conversions/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func timestampToExpiration(t *types.Timestamp) string {

// ParseTimestamp tries to parses the ocs expiry into a CS3 Timestamp
func ParseTimestamp(timestampString string) (*types.Timestamp, error) {
parsedTime, err := time.Parse("2006-01-02T15:04:05Z0700", timestampString)
parsedTime, err := time.Parse(time.RFC3339, timestampString)
if err != nil {
parsedTime, err = time.Parse("2006-01-02", timestampString)
}
Expand Down

0 comments on commit 628915c

Please sign in to comment.