I have to create a dynamically changing string for a Task custom field . The Apex code uses Last Modified Date within the EST time zone.

My question is:

Doesn't Salesforce handle the Daylight Savings time (DST) for Last Modified Date so that I don't have to worry about calculating the DST offsets but rather, only focus on making sure the time zone is correct?


1 Answer 1


All Datetime values are stored as UTC values in the database. Many of the mechanisms in Salesforce automatically convert these values to and from the contextual User's time zone (e.g. SOQL and DML in Apex, the standard UI components etc.).

As such, as long as the User time zone is correctly specified as one supporting DST you should have the effect you want.

Note, however, that Datetime manipulation, such as adding days or hours, or similar, or subtraction of one Datetime from another, may not have the results you want over a DST transition (depending on what you want to achieve).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .