Skip to content

Commit

Permalink
Allow parsing of decimal precision iso8601 formats (#3489)
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail committed Aug 19, 2020
1 parent e219d85 commit 0d73a4a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_PENDING.md
@@ -1,5 +1,6 @@
### SDK Features

### SDK Enhancements
* `private/protocol`: The SDK now supports the serialization of ISO8601 date-time formats with fractional seconds precision. ([#3489](https://github.com/aws/aws-sdk-go/pull/3489))

### SDK Bugs
2 changes: 1 addition & 1 deletion private/protocol/timestamp.go
Expand Up @@ -28,7 +28,7 @@ const (
ISO8601TimeFormat = "2006-01-02T15:04:05.999999999Z"

// This format is used for output time without seconds precision
ISO8601OutputTimeFormat = "2006-01-02T15:04:05Z"
ISO8601OutputTimeFormat = "2006-01-02T15:04:05.999999999Z"
)

// IsKnownTimestampFormat returns if the timestamp format name
Expand Down
7 changes: 6 additions & 1 deletion private/protocol/timestamp_test.go
Expand Up @@ -26,13 +26,18 @@ func TestFormatTime(t *testing.T) {
"ISO8601Test1": {
formatName: ISO8601TimeFormatName,
expectedOutput: "2000-01-02T20:34:56Z",
input: time.Date(2000, time.January, 2, 20, 34, 56, .123e9, time.UTC),
input: time.Date(2000, time.January, 2, 20, 34, 56, 0, time.UTC),
},
"RFC822Test1": {
formatName: RFC822TimeFormatName,
expectedOutput: "Sun, 02 Jan 2000 20:34:56 GMT",
input: time.Date(2000, time.January, 2, 20, 34, 56, 0, time.UTC),
},
"ISO8601Test2": {
formatName: ISO8601TimeFormatName,
expectedOutput: "2000-01-02T20:34:56.123Z",
input: time.Date(2000, time.January, 2, 20, 34, 56, .123e9, time.UTC),
},
}

for name, c := range cases {
Expand Down

0 comments on commit 0d73a4a

Please sign in to comment.