6 ms·
Sure, but regardless of input format, the test in GP's comment would indicate that October 22, 2021 is not before November 21, 2021. The right test is somethin
by tczMUFlmoNk 3y ago
Sure, but regardless of input format, the test in GP's comment would indicate that October 22, 2021 is not before November 21, 2021.
The right test is something like "year < 21 || year == 21 && (month < 11 || month == 11 && (day <= 21))". And yes, probably refactor that logic for clarity, but from this form you can see that it is not equivalent to the test above.
- p_l 3y agoThe code as deployed has errors (the link actually shows ghidra decompile of relevant portion). Months & days are counted from 1. The error is what makes it so that instead of failing "unfixably" once 2021-11-21 happens, it instead simulates failure between nov. 21 and dec. 1, and dec. 1 and january 1, every year starting with 2021.
- icehawk 3y agoYes. Its that second part that makes me unsure. Not that they're checking month and day and year.
- p_l 3y agoDAY >= 21 AND MONTH >= 11 AND YEAR_2digit >= 21 The condition yields true from 2021 on for: nov. 21 - nov. 30 dec. 21 - dec. 31
- turquoisevar 3y agoThis might be on purpose if they’re merely trying to make the third party maintenance company look unreliable.
- petre 3y agoJust in time for the Christmas rush. This calls for criminal prosecution.
- icehawk 3y agoI reversed the direction of the tests, as pointed out, but the original logic would fail to detect that say June 22, 2022 is after 21 November 2021.