3

Does anyone know a way to include the time zone abbreviation on dates/times displayed on standard Salesforce forms? We have users who travel across the country, and we have a default time zone set, but still encounter confusion from our users.

I'd expect to find this somewhere where you could customize a locale in SF, but I'm unable to find such a thing. Just trying to add "zzz" to the end of the date format string.

2 Answers 2

2

You can't really alter the UI, unless you're willing to make formula fields for every single field, which isn't particularly scalable. Perhaps you might consider simply showing a "time zone" widget on the sidebar, and allow users to select a new time zone that way. Just create a new VF page and show it on the sidebar of your home page. Using "Show Custom Components On All Pages" will let you at least identify what time zone the user is currently using. It can be as simple as:

<apex:page controller="{!userTz}">
    <apex:form id="form">
        You are currently using <b>{!User.TimeZoneSidKey}</b>.
        <apex:inputField value="{!User.TimeZoneSidKey}">
            <apex:actionSupport event="onselect" oncomplete="window.top.location.reload()" />
        </apex:inputField>
    </apex:form>
</apex:page>

public class UserTZ {
    public User user { get; set; }
    public UserTZ() {
        user = [SELECT TimeZoneSidKey FROM User WHERE Id = :UserInfo.getUserId()];
    }
    public void save() {
        update user;
    }
}
1

Most likely not. The datetime in Salesforce is always stored on the records in GMT (UTC). The time is shown in the user's time zone when displaying it on the UI.

The user can always update their timezone by going to Setup > My Personal Information (on the left side of the page) > Personal Information > Language & Time Zone.

2
  • The question isn't about how time is stored, I'm just saying that any time a time is displayed, I want to include the time zone as part of that. Showing "3pm" is ambiguous when you have a mobile workforce, and the simple solution is to always show the TZ. Commented Sep 18, 2015 at 16:03
  • @JamesBoutcher Thats what I have tried to explain. There is a default timezone for the Org and user can update their personal timezone when they move to a different timezone. help.salesforce.com/apex/…
    – Saroj Bera
    Commented Sep 18, 2015 at 16:16

You must log in to answer this question.

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