Does salesforce.com have a time zone field that DST knows?

I send reminders to potential customers, and the time is converted to our server time zone EST (I think it currently uses EDT, although as needed). I need to save the time zone for a potential client and translate the time into the current time zone.

I can keep the offset, but I'm worried about daylight saving time. I can always store a non-DST offset, but this causes problems when a registration assignment is scheduled before DST, but occurs after DST.

Ideally, I would like to keep the time zone, and if necessary, Salesforce will translate the date and time into this time zone, which will take into account DST. How can i do this?

+6
salesforce
source share
2 answers

Salesforce will not convert the UTC value stored in the database to an arbitrary time zone. It will only be converted to the user's time zone of the context. You can try changing the locales of the active user every time you call the API call, but that would be expensive.

As you said, you need to save the time zone, then use the datetime library and convert your Salesforce user from the time zone (it might be easier to have a user who is in UTC, but not necessary) into your client’s time zone.

+1
source share

AddressTools is an application available in Salesforce AppExchange that includes this feature and much more.

Watch a video demonstration of the function here .

Or visit the AppExchange list here .

0
source share

All Articles