Fix ISO-8601 date format preservation during data migration#221
Merged
Fix ISO-8601 date format preservation during data migration#221
Conversation
…sonCosmosSerializer settings and add DateTimeOffset support Co-authored-by: markjbrown <[email protected]>
Co-authored-by: markjbrown <[email protected]>
Copilot
AI
changed the title
[WIP] Fix ISO-8601 date format change during migration
Fix ISO-8601 date format preservation during data migration
Dec 1, 2025
philnach
approved these changes
Dec 1, 2025
Collaborator
philnach
left a comment
There was a problem hiding this comment.
Looks good to me. Fixes a long standing issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Date strings like
"2023-12-19T00:00:00.000Z"were being changed to"2023-12-19T00:00:00Z"during Cosmos-to-Cosmos migration due to inconsistent serialization settings.Changes
CosmosDataSinkExtension.cs:
CreateItemStreamnow usesRawJsonCosmosSerializer.GetDefaultSettings()instead of defaultJsonConvert.SerializeObject, ensuring consistent date handling between stream and non-stream write modesDataItemJsonConverter.cs (core layer): Added
DateTimeOffsetsupport alongside existingDateTimehandling, usingGetAsUnescaped()to preserve+in timezone offsetsTests Added
CreateItemStream_WithDateString_PreservesFormatCreateItemStream_WithNestedDateString_PreservesFormatCreateItemStream_WithDateStringArray_PreservesFormatDateTimeOffsettest cases inDataItemJsonConverterTestsWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
http://crl3.digicert.com:443/DigiCertCSRSA4096RootG5.crl/usr/bin/dotnet dotnet build CosmosDbDataMigrationTool.sln(http block)http://crl3.digicert.com:443/DigiCertTrustedG4TimeStampingRSA4096SHA2562025CA1.crl/usr/bin/dotnet dotnet build CosmosDbDataMigrationTool.sln(http block)http://crl3.digicert.com:443/NETFoundationProjectsCodeSigningCA2.crl/usr/bin/dotnet dotnet build CosmosDbDataMigrationTool.sln(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.