What is the use of @(Pega-RULES:BusinessCalendar).addTime() function in pega

For SLA deadline another team has set pySLADeadline equal to @(Pega-RULES:BusinessCalendar).addTime(Param.RequestRecTime,1,0,0,0,true,Param.CalendarName) in a DT,so I want to understand what is the usage of this function ?As we also need to implement the similar logic

@TanyaS58

It adds days/hours/mins/seconds from the the input param startDateTime provided and returns in GMT. If useBusinessCalendar is set to true, but no calendarName is specified, ‘Default’ calendar is used. If it fails obtaining calendarCache for the calendarName, or if any exception happens while adding business or calendar time to a startDateTime then also ‘Default’ calendar is used. If useBusinessCalendar is set to false, then a GregorianCalendar is obtained with ‘GMT’ timeZone and adds days, hours, minutes , seconds by setting Calendar time to startDateTime.

Eg: @BusinessCalendar.addTime(“20160308T010000.000 EST”, 0, 1, 0, 0, true, “USDefault”) will return 20160308T140000.000 GMT.

@SohamM95 so basically in my case it will add 1 day to Param.RequestRecTime and then return the time in GMT or it will return the time in the time zone of which we are using the calendar?

@TanyaS58

Pega stores all datetime fields in GMT backend. It is displayed as per your operator timezome/locale on the UI. So in your case, it’ll add 1 day from the GMT time of Param.RequestRecTime and return in GMT format, but on frontend you will see in whatever timezone you’re using.