11

I just want to know whether salesforce internally uses DST. How can I check that? Any thoughts?

2 Answers 2

20

All Datetime field values are stored in GMT internally. They are then adjusted automatically (on std page laouts) for display to match the users Timezone.

This is so that there is one uniform Timezone effective in the database layer and the (notional) controller adjusts this value to the users Timezone to display in the view (MVC)

So if you saved a record while DST was effective, it would display as that, but internally it would still store as GMT. (i.e. subtract one hour in addition to applying the Timezone correction to GMT)

Eg if I created a record at 9 AM in July (when DST is in use, i.e. GMT + 1) with the user timezone as United Kingdom, it would store 8 AM in the CreatedDate because it corrects to GMT by subtracting an hour.

If however I created that record in January when the UK is GMT, at 9 AM, the CreatedDate would store 9 AM, because that is the true GMT time.

If you want to store a time in GMT without the platform applying a correction, suffix the Datetime with Z, the Zulu, which tells it that this is the time in GMT. Eg 2012-11-15 T03:31.00.000Z

2
  • That makes sense but is there any way to check?
    – doga
    Nov 16, 2012 at 3:13
  • Sure, use a soql query to select the CreatedDate or any other datetime field for a record created in a Summer month and compare the value you get with the one that's displayed on a page layout. BST = GMT + 1, so it will display as 9 am BST, but would be stored as 8 AM GMT. Nov 16, 2012 at 3:18
1

No salesforce does not interally use DST. Things are stored in GMT and the display of the date/time are in the users settings on their profile.

The 'Locale' setting controls the date format: MM-DD-YYYY or DD-MM-YYYY for example.

You must log in to answer this question.

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