Support Article
DateTimeDifference function "h" precision doesn't return decimal
SA-3523
Summary
When you use the DateTimeDifference function with a specified precision, you notice the return value doesn't contain the decimal part associated the time difference.
Error Messages
None
Steps to Reproduce
- Create an activity
- Add a Property-Set step which assigns "@(Pega-RULES:DateTime).DateTimeDifference("20141112T193000.000 GMT", "20141112T200000.000 GMT", "h")" to a double property.
- Review the results
Root Cause
The root cause of this problem is a defect in customer application code/rules. The expected behavior of DateTimeDifference is to return only the whole number value of the difference over the precision.
Resolution
This issue is resolved through the following local change:
Create a custom rule-utility-function that doesn't call the floor function to remove the decimal component of the return. For assistance with this, contact GCS.
Published January 31, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.