Support Article

AddTime function returns wrong date for business calendar



The addTime function does not calculate correct time, when calendar instance is passed as parameter. It calculates correct time when calendar instance is not passed.

Error Messages

Not Applicable

Steps to Reproduce

1. Create Calendar rule with America\New York timezone.
2. Mention the business days from Monday to Friday.
3. Mention the Business hours from 9:00 AAM to 4:00 PM.
4. Write an activity which calls the addTime function to add the 1 day time to 
20160720T200100.000 GMT.

Root Cause

User has given the start date as 20160720T200100.000 GMT, it means 21stJune 8:01 PM in GMT.

As calendar timezone is America or New York, PRPC converts given date to America\New York timezoen, so it becomes 21st June 4:01 PM.

As user mentioned business hours upto 4:00 PM, PRPC takes next business day as starting date and add 1 day to it, So it becomes next to next business day.


This is an expected behavior from PRPC as per Calendar configuration.


Published August 8, 2016 - Updated August 22, 2016

Have a question? Get answers now.

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