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 import "dates.r".

CATHOLICEASTER(year)

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

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 */

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

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

EASTER(year)

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

GMTIME(time)

Returns the broken time structure in Greenwich mean time year/mon/day hour:min:sec from the time representing the number of seconds elapsed since 1/1/1970
SAY GMTIME(1022237371) /* 2002/5/24 10:49:31 */

MKTIME(time|[year,month,day,hour,mon,sec])

Returns elapsed number of seconds since 1/1/1970 for the normalized time year/mon/day hour:min:sec
SAY MKTIME("2002/5/24 10:49:31") /* 1022237371 */

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 */

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