Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Time is calculated incorrectly for a given BusinesCalendar



The "addTime" Rule-Utility-Function (RUF) is used to add an integral number of days to a particular date-time which is outside of normal business hours. The computed date-time has to be at the start time of the particular day output by the RUF.  However, the time is in the middle of the business day.

Error Messages

Not Applicable

Steps to Reproduce

  1. Setup a Calendar.
  2. Setup a data transform to call the function @(Pega-RULES:BusinessCalendar).addTime. Provide a start time which is outside of the business hours on the initial day provided to the RUF.
  3. The outcome of the RUF is on the correct day, but not at the beginning of the business day as set up by the calendar.

Root Cause

The root cause of this problem is software use/operation error.

For this calendar, not all days start at the same time. For this use case, the day after the start day starts at a later time than the other days of the calendar. 


The algorithm that is used by RUF first rolls the date-time forward to the start of the next business day (since the start time is outside of normal business hours).  It is this time (the start time of the next business day as provided by the calendar) that is then used when adding the requested number of days.  If, on the final target day, the start time of that day is earlier than the start time in the initial calculation, the time is not rolled back to the start of that final target-day's start time. The time remains as the start time of the day after the initial day.

Published November 18, 2015 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us