Skip to content

fix(coreprops): parse fractional seconds in W3CDTF timestamps - #1157

Open
draarivpatel-ui wants to merge 1 commit into
scanny:masterfrom
draarivpatel-ui:fix-w3cdtf-fractional-seconds
Open

draarivpatel-ui wants to merge 1 commit into
scanny:masterfrom
draarivpatel-ui:fix-w3cdtf-fractional-seconds

Conversation

@draarivpatel-ui

Copy link
Copy Markdown

Fixes #1155.

A core-property timestamp with a decimal fraction of the second, such as 2026-01-01T00:30:00.125+05:30, is currently read as 2026-01-01 00:30:00 instead of the expected 2025-12-31 19:00:00.125000.

The parser slices the first 19 characters as the parseable part, so the fractional seconds land in the offset remainder together with the timezone designator. The combined remainder is never exactly six characters long, so both the fraction and the numeric offset are silently dropped and no UTC conversion happens.

This change parses the fractional part before examining the timezone offset, truncating to microsecond precision, so timestamps with fractional seconds get the same UTC conversion as integral ones. Applies to created, modified and last_printed.

A core-property timestamp with a decimal fraction of the second, such as
2026-01-01T00:30:00.125+05:30, had everything after the 19th character
treated as a timezone offset. Since the remainder was never exactly six
characters, both the fraction and a numeric offset were silently dropped
and the value was read as local time without UTC conversion.

Parse the fractional part before examining the offset, truncating to
microsecond precision.

Fixes scanny#1155
Copilot AI balanced review requested due to automatic review settings November 25, 2026 23:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fractional core-property timestamps are read without UTC conversion

2 participants