Discussion
addDays function returning different values
Hi,
We are using addDays function to add a specified number of days to a Date. This function is used within an Activity and this Activity is called from two different applications. In most of the cases, the resulting date will be same in both the applications. However, in very few cases, the dates are different - one day less in the second application. The Primary page used is different in each application. Upon tracing, I found that the date difference is after the addDays function is executed I mean there is no other formatting or logic that is used down the line to update these dates. We are using the @addDays(String,int,boolean,String) format of this function. Any insights on why this could be happening and only in some cases?
Hello,
It might be due to the timezone being different for each requestor. Look on the pxRequestor page under system pages to see if the property pyUseTimeZone is different. 10 pm in New York on December 31st is January 1st in London. That could be your one day difference.
Regards,
Tara
Pega Academy Support Team