-
Notifications
You must be signed in to change notification settings - Fork 190
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
Implement Display Trait for DateTime #3183
Implement Display Trait for DateTime #3183
Conversation
I don't know if I need to any updates on CHANGELOG.next.toml so I didn't do anything with it. If it is necessary can you help me on that? |
let datetime = | ||
chrono::NaiveDateTime::from_timestamp_opt(self.seconds, self.subsecond_nanos).unwrap(); | ||
let formatted = datetime.format("%Y-%m-%dT%H:%M:%S%.fZ"); | ||
write!(f, "{}", formatted) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using chrono, we should use the date time support already built into datetime: https://docs.rs/aws-smithy-types/latest/aws_smithy_types/date_time/struct.DateTime.html#method.fmt
make sure to also remove the chrono dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll also need at least one test
You should add the following:
|
Is this better? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Motivation and Context
It implements Display trait For DateTime
#3161
Description
I implemented Display trait for DateTime
Testing
I used this test
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.