Support Article
addCalendar- when adding Months the DST maps 1 hour less.
SA-36461
Summary
When adding time (weeks, month, years, and under some circumstances, also days) to a DateTime property, using the DateTime.addCalendar() function, this would result in one hour less or more than expected, given that a daylight savings time switch date is within the spanned period of time.
Another supposition is that the server's time zone setting is UTC - as recommended - or another time zone with a different DST handling than the client's time zone, and that the client time zone knows daylight savings time periods.
Error Messages
There were no error messages
Steps to Reproduce
Use the DateTime.addCalendar() function to add x number of months to a date.
Root Cause
The function DateTime.addCalendar() did not consider the client time zone; it always worked with the server's time zone setting.
Resolution
Apply HFix-33499.
Published May 6, 2017 - 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.