Professional Documents
Culture Documents
Dates Manipulation
Dates Manipulation
Posted by Marc
CURRENT.TIME = TIMEDATE()
Date formatting:
CALL DIETER.DATE(DATE.IN,DATE.OUT,’D’)
Example:
ORD.DATE = R.DXO<DX.ORD.TRADE.DATE>
ORDER.DATE = ''
Example:
REMAIN.CAL.DAYS = "C"
START.DATE = TODAY
END
CALL CDT(YREGION,YDATE, YDAYS)
With:
YREGION only necessary when calculating working days
YDATE= YYYYMMDD
YDAYS: number without (= ‘+’) or with ‘+’ or ‘-‘ sign in front and without (= ‘W’) or
with ‘W’ (= Working days to be calculated) or ‘C’ (=Calender days to be calculated) at
the end.
Definition may be multiple: e.g. ‘+02W03C’ or ‘+10W-3C’
Example:
if TODAY = 20140606
Example with “date_to_check” which can be the next open day if it’s a banking holiday:
COUNTRY.CODE = ''
COUNTRY.CODE = R.COMPANY(EB.COM.LOCAL.COUNTRY)
RETURN.CODE = ""
CALL WORKING.DAY('',date_to_check;,'','','',COUNTRY.CODE,'','',RETURN.CODE,'')
IF RETURN.CODE = 0 THEN
(...)
END ELSE
ADJ.MAT.DATE = date_to_check
CALL CDT('',ADJ.MAT.DATE,'+1W')
(...)
END