Dates.sbr	Dates operations		By Ami Bar-Yadin
SYNTAX:		XCALL DATES,FUNC,RESULT,date1{,date2}{,days}
Functions:
	1	Convert from any format to any format (date1 --> date2)
	2	date2 = date1 + days
	3	days  = date1 - date2
	4	date2 = date1[year, y-week, DOW]
	5	date2 = date1[year, month, m-week, DOW]
	6	date2 = date of last day of month in date1
$ODTIM  7	(interface) DATES,7,0,DATE,TIME,FLAGS,OUT BUFFER or FILE#
$IDTIM	8	(interface) DATES,8,RESULT,INPUT,FLAGS,OUT DATE,OUT TIME

Notes for functions 4 and 5:
	Compute date2 using only indicated data from date1
	date1 must be an X with at least 5 bytes (for func#4)
	date1 must be an X with at least 6 bytes (for func#5)
Notes for function 6:
	Compute a date (date2) which is the last day of the same month
	that is in date1
Notes for function 7:
	This function provides an interface to $ODTIM
	(See AlphaBasic XCALL ODTIM for more details on flags)
Nots for function 8:
	This function provides an interface to $IDTIM
	(See AlphaBasic XCALL IDTIM for more details on flags)

DATE DATA FORMATS:
	ASCII		ADATE,S,8		("01/05/83")
	Seperated	BDATE,X,{3..7}
			  MONTH,B,1		1..12 : January..December
			  DAY,B,1		1..31
			  YEAR,B,1		
			  DOW,B,1		1..7  : Monday..Sunday
			  YWEEK,B,1		1..52 : Week of year
			  MWEEK,B,1		1..5  : Week of month
			  MDAYS,B,1		1..31 : Days in month
	Internal	IDATE,B,4		True Julian	B,4
	16 bit		CDATE,B,2		Century Julian	B,2
	Julian		JDATE,F			Yearly Julian	F
Note: 
A floating point 0 will be converted to today's date on input.
for example  XCALL DATES,1,RESULT,0,A$   Will return A$ with today's date.

RESULT (F) CODES:
	0	ALL OK
	1	FUNCTION NUMBER OUT OF RANGE (1..6)
	2	ERROR IN CONVERSION OF INPUT DATE
	3	INVALID FORMAT FOR DATE
	4	IMPROPER NUMBER OF PARAMETERS
	5	INVALID FORMAT FOR DAYS

.
