addDays(String, int, boolean, String) is inconsistent. When 1 business day is added to the date I am getting the result as the same day as input
We have a requirement where we need to add(1 or 2 or 5) days to the case creation date. I am using the addDays() functon where I pass a dateTime and add number of days accoriding to the requirement. We are using our own calendar which is set in CST time zone and have our set of holidays defined. We are storing the result in DateTime property. We are facing inconsistency where when we add one day to the dateTime passed we are getting the same date. Like, if I pass "20161228T150000.532 GMT" and add one day using addDays(DateTime, 1, true, CalendarName) I am getting the result as "20161228T183000.000 GMT". We are facing the issue only in UAT testing environment. We are not facing the issue in lower environments. The only differene I could find between the two environments is that lower environment server is located in CST time zone and UAT environment server is located in EST time zone.
One important thing to note is that we are facing the issue only when we are running the function before 3PM IST(Indian Standard Time). We are not facing the issue after 3 PM IST on the same day even though we pass the same "20161228T150000.532 GMT" value.
***Updated by moderator: Lochan to add Categories***