Previous Top Index Next

External Date Functions (DOS+UNIX)

The following routines are available after loading the library file dates.r with the command: CALL load "dates.r".

DAYOFWEEK("day/month/year" | day,month,year)

Returns the day of week 0=Sun, 1=Mon, ... 6=Sat.
SAY dayofweek(1,1,2000) /* 6 */
SAY dayofweek("1/1/2000") /* 6 */

EASTER(year)

Reutrns the Greek Orthodox Easter in April. If Easter > 30 then Month = May, Easter = Easter - 30
SAY easter(2000) /* 30 of April */

DAYSOFMONTH("month/year" | month,year)

Returns the days of month month in year year
SAY daysofmonth(2,2000) /* 28 */

ADDMONTHS("day/month/year",months | day,month,year,months)

Returns the new date increased by months.
SAY addmonths(28,2,2000,13) /* "28/3/2001" */

ADDDAYS("day/month/year",days | day,month,year,days)

Returns the new date increased by days.
SAY adddays(28,2,2000,-100) /* "20/11/1999" */

SWAPDATE("day/month/year" | day,month,year)

Swaps the date from US format to European format.
SAY swapdate("28/2/2000") /* "2/28/2000" */

JULIAN("year/month/day" | juliandate)

JULIAN -- Ordered to Julian and Julian to Ordered date conversion
(c) Eric Thomas 1986 (ERIC at FRECP11)
This routine will convert a date from yy/mm/dd to yyddd format or vice-versa. The input parameter is assumed to be of correct syntax; although some basic checks are performed, it is most probable that a REXX error will occur if the argument is incorrect (eg 85999).
SAY julian(84249) /* "84/09/05" */
SAY julian("84/09/05") /* 84249 */


Previous Top Index Next