What is the usage of @DateTime.pxGetSpecifiedTimeOnDate() function in pega.

Why is @DateTime.pxGetSpecifiedTimeOnDate() used and how is it different from @(Pega-RULES:BusinessCalendar).addTime() in pega

@TanyaS58

@DateTime.pxGetSpecifiedTimeOnDate() returns a datetime stamp for a specified time on a given day. Uses requestor’s default time zone if not specified, and current date if time not specified. Input can be either date or datetime.

Regarding differences primarily what I know here is you can’t specify any business calendar.

@SohamM95 can you please provide an example to elaborate more on the @DateTime.pxGetSpecifiedTimeOnDate() usage?

@TanyaS58

Let’s say the SLA time needs to be set to 11:59 pm on the next business, then you input: @pxGetSpecifiedTimeOnDate(@nextBusinessDay(@getCurrentTimeStamp(), pxRequestor.pyCalendar), 23, 59, 0, “”)

@SohamM95 so bascially it will return the time as 11:59 always on the input date time value we provide

@TanyaS58

The output will be ‘20240501T045900.000 GMT’ if EST is set as the input timezone.