date: military format no longer offsets the current day by one#9784
date: military format no longer offsets the current day by one#9784Darius-Constantin wants to merge 3 commits intouutils:mainfrom
Conversation
Signed-off-by: Darius-Constantin <darius.constantin04@stud.acs.upb.ro>
… to the first day possible Signed-off-by: Darius-Constantin <darius.constantin04@stud.acs.upb.ro>
|
GNU testsuite comparison: |
CodSpeed Performance ReportMerging #9784 will not alter performanceComparing Summary
Footnotes
|
|
Hi! I also worked on this issue and wanted to point out a few edge cases that may not be fully covered by this implementation. Military time doesn’t always require rolling the date back by one day. For example:
In this case, the date should remain the same day.
Here, the result should actually roll over to tomorrow. PR #9785 addresses these cases and includes tests covering the full set of known edge cases. It might be worth comparing the approaches to ensure all scenarios are handled correctly. |
Fixes #9775
Considering there was always an offset of 1 day ahead, I corrected it by subtracting a day. In case the subtraction fails (I am not sure if there is any real case when this happens), I fall back to the first date available (1970-01-01).
I am quite unsure of how a test could be written for this issue.