Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Display impl for DateTime (#3235)
## Motivation and Context <!--- Why is this change required? What problem does it solve? --> It implements Display trait For DateTime <!--- If it fixes an open issue, please link to the issue here --> #3161 ## Description <!--- Describe your changes in detail --> I implemented Display trait for DateTime ## Testing <!--- Please describe in detail how you tested your changes --> <!--- Include details of your testing environment, and the tests you ran to --> I used this test ```rust fn test_display_formatting() { // Create a DateTime instance for testing let datetime = DateTime { seconds: 1636761600, // Example timestamp (replace with your actual timestamp) subsecond_nanos: 123456789, // Example subsecond nanos (replace with your actual value) }; // Expected RFC-3339 formatted string let expected = "2021-11-13T00:00:00.123456789Z"; // Format the DateTime using Display trait let formatted = format!("{}", datetime); // Assert that the formatted string matches the expected result assert_eq!(formatted, expected); } ``` <!--- see how your change affects other areas of the code, etc. --> ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [ ] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [ ] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._ --------- Co-authored-by: Hakan Vardar <[email protected]>
- Loading branch information