Fix ISO 8601 date parsing to support variable precision by leoromanovsky · Pull Request #10419 · DataDog/dd-trace-java
The DateAdapter was using a DateTimeFormatter with a fixed [.SSS] pattern, which only supports optional 3-digit milliseconds. This caused dates with 6-digit microsecond precision (e.g., "2025-09-23T15:48:37.235982Z") sent by the backend to silently fail parsing (returning null). Changed to use Instant.parse() which correctly handles all valid ISO 8601 date formats including: - No fractional seconds: 2020-01-01T00:00:00Z - 1-9 digit fractional seconds (beyond ms precision truncated by Date) - UTC offsets: 2023-01-01T01:00:00+01:00 Added comprehensive unit tests for various date precisions and updated smoke test data with microsecond-date-test flag and test cases.
leoromanovsky
changed the title
[Feature Flags] Fix ISO 8601 date parsing to support variable precision
Fix ISO 8601 date parsing to support variable precision
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