https://bz.apache.org/bugzilla/show_bug.cgi?id=70229
Bug ID: 70229
Summary: Parsing a date with fractional seconds offsets it by
that many milliseconds
Product: POI
Version: 5.5.1-FINAL
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: OPC
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
In
https://github.com/apache/poi/blob/REL_5_5_1/poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java#L683-L692,
parseDateFormat parses W3CDTF timestamps using SimpleDateFormat patterns
including "yyyy-MM-dd'T'HH:mm:ss.SS'Z'". For a timestamp with more than 2
fractional-second digits, such as 2026-01-01T00:00:00.999999999Z, this pattern
still matches. The entire fractional-digit string is then read as a millisecond
count and added to the timestamp: 999999999 ms (≈11.57 days) gets added,
producing 2026-01-12T13:46:39Z instead of 2026-01-01T00:00:00Z.
This bug also still exists in 5.5.X.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]