Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow parsing of decimal precision iso8601 formats #3489

Merged
merged 2 commits into from Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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