MMDDYY2B and B2MMDDYY: Convert dates between MM/DD/YY and Base formats
Автор: Rex Swain
Дата: 1999
Источник: www.rexswain.com
The REXX program MMDDYY2B.REX converts MM/DD/YY dates to the REXX "Base" date format -- the number of days between the specified date and the "base" date (01 January 0001).
The program B2MMDDYY.REX converts Base format dates to MM/DD/YY format.
For example:
d = mmddyy2b('12/31/1999') /* returns 730118 */ j = b2mmddyy(d+1) /* returns '01/01/2000' */
These utilities are helpful when using a REXX implementation that do not have a built-in dateconv() function.
Many thanks to Peter Baum for his excellent set of date algorithms.