Bug #2154
Date arithmetics and Gregorian gap
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
05/24/2013
Due date:
% Done:
0%
billable:
No
vendor_id:
GCD
case_num:
version:
Related issues
History
#1 Updated by Ovidiu Maxiniuc almost 11 years ago
While implementing add-interval
/ interval
functions for date/datetime/datetim-tz I encountered some particular cases of date/datetime arithmetic, namely the "Gregorian gap".
It looks like Progress has some small bugs here, which will probably need to be duplicated.
Here are some examples:
add-interval(10/04/1582, +1, "month") EQ 11/14/1582 /* I was expecting 11/04/1582 here */
but in reverse:
add-interval(11/14/1582, -1, "month") EQ 10/24/1582 /* I was expecting to get the initial 10/04/1582 */
On the other hand,
add-interval(10/15/1582, -1, "month") EQ 09/15/1582 /* this looks normally */
but the reverse is:
add-interval(09/15/1582, +1, "month") EQ 10/25/1582 /* not the initial 10/15/1582 */
At this moment I cannot figure exactly how Progress handles this arithmetic as the size of months differs:
MESSAGE INTERVAL(ADD-INTERVAL(10/15/1582, -1, "month"), 10/15/1582, "days"). /* = -20 */ MESSAGE INTERVAL(ADD-INTERVAL(09/15/1582, +1, "month"), 09/15/1582, "days"). /* = 30 */
For the moment, I suspended the work on this, as probably this year will not be very used in today's applications.