There are lots of posts regarding
DateTime format. But there are things for which I still can't find a solid answer.
- I Noticed that
Datetimefield values are converted into UTC and that converted values are kept in the back-end. When rendering those values in the UI, they will be converted back into the Organization/User's timezone.
- Is it only the values which are coming directly from the UI (user entered) that are converted or it is any
Datetimefield values (such as the ones updated through controllers or triggers) that are converted?
- In a
SOQL WHEREclauses, what is the best way to use
DateTimefields to avoid potential confusing search results?
I recently noticed this behavior in Salesforce and managed to resolve the difficulties. But I really need to get a clear understanding of the ins-and-outs as a developer :).
Below are the assumptions for each of the aboves that I have taken based on my understanding up until now.
- All the fields will be converted. No matter if the value has been set by
DATE_TIME_FORMAULA(convertTimeZone(*dateTime*)) = myValuewill help here. Until now I've been able to manage with
Datefields since there was no need to filter based on time.
When retrieving data via a REST web service does this conversion also happen?