Skip to content

date: treat +N after a timezone as a relative item - #17010

Open
seragAhmed wants to merge 1 commit into
uutils:mainfrom
seragAhmed:fix/17000-date-zone-relative-days
Open

seragAhmed wants to merge 1 commit into
uutils:mainfrom
seragAhmed:fix/17000-date-zone-relative-days

Conversation

@seragAhmed

Copy link
Copy Markdown
Contributor

parse_relative_plus handles 12:00:00 +1 hour, where +1 is the clock's offset and hour is a relative item. It also kicked in when a zone sat between the clock and the number, so 12:00:00 EST +7 days became EST with a +7 offset plus a single day, and came out six days early.

It now only applies when the signed number directly follows the clock; otherwise the input goes to the normal parser, which already gets EST +7 days right. The test covers the EST and CET cases from the issue and the unzoned case, which still matches GNU.

Fixes #17000

A signed number is only an offset of the clock when it follows it directly.
After a zone like EST, "+7 days" was split into a timezone offset of +7 and
a single day, so the result was six days early.

This branch has not been deployed

No deployments
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.

date: +7 days after an EST timestamp produces a deadline over six days early

1 participant