50% found this document useful (2 votes)
1K views2 pages

T24-Dates Manipulation

This document provides examples of how to manipulate dates in different ways using functions: 1) Get detailed date and time information by formatting the output of the TIMEDATE() function. 2) Format dates using the DIETER.DATE function by specifying the input, output dates and format type. 3) Compute the difference between dates in working or calendar days using the CDD function. 4) Derive a date by adding or subtracting days using the CDT function, specifying the date, number of days and day type. 5) Check if a date is an open banking day using the WORKING.DAY function.

Uploaded by

Heng Puthea
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
1K views2 pages

T24-Dates Manipulation

This document provides examples of how to manipulate dates in different ways using functions: 1) Get detailed date and time information by formatting the output of the TIMEDATE() function. 2) Format dates using the DIETER.DATE function by specifying the input, output dates and format type. 3) Compute the difference between dates in working or calendar days using the CDD function. 4) Derive a date by adding or subtracting days using the CDT function, specifying the date, number of days and day type. 5) Check if a date is an open banking day using the WORKING.DAY function.

Uploaded by

Heng Puthea
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Dates Manipulation

wikibanking.info/2012/09/dates-manipulation/

Marc September 6, 2012

Get detailed date time information:


* Time HH:MM:SS DD MMM YYYY

CURRENT.TIME = TIMEDATE()

CURRENT.TIME = CURRENT.TIME[1,2]: ':' : CURRENT.TIME[4,2]: ':' :


CURRENT.TIME[7,2]

* will give a time of "18:51:00" for instance.

Date formatting:

CALL DIETER.DATE(DATE.IN,DATE.OUT,’D’)

Example:

ORD.DATE = R.DXO<DX.ORD.TRADE.DATE>

(for instance= '20151106')

ORDER.DATE = ''

IF (ORD.DATE) THEN CALL DIETER.DATE(ORD.DATE,ORDER.DATE,'D')

=> gives ORDER.DATE = '06 NOV 2015'

Compute a difference between 2 dates:

CALL CDD(YREGION,START.DATE, END.DATE, DAYS.DIFF)

With DAYS.DIFF set to W for a difference in working days, C for a difference in calendar
days. After the call, DAYS.DIFF will contain the days difference. No region (first
parameter equals “”) means default region “00”.

Example:

REMAIN.CAL.DAYS = "C"

START.DATE = TODAY

IF START.DATE < EXPIRY.DATE THEN

CALL CDD('',START.DATE, EXPIRY.DATE, REMAIN.CAL.DAYS)

END

=> gives REMAIN.CAL.DAYS = 115

Derive a date by adding or subtracting a number of days:

CALL CDT(YREGION,YDATE, YDAYS)

With:

YREGION only necessary when calculating working days


YDATE= YYYYMMDD

1/2
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

       PROCESS.DATE = TODAY

       DAY.COUNT = "-3W"

       CALL CDT('', PROCESS.DATE, DAY.COUNT)

=> gives PROCESS.DATE = 20140603

 Check if a day is open or a banking holiday

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                         

2/2

You might also like