4

I want to know the timezone of the timestamp value in systemmodstamp column in my SF objects.

1
  • All times are stored in UTC and converted for display according to the user's locale settings.
    – Mike Chale
    Commented Dec 17, 2013 at 13:42

1 Answer 1

9

Date values are stored in UTC time format in Salesforce, the timezone is only applied when the date is displayed. If you are in Apex, you can use the various methods it provides to return an automatically adjusted value or the GMT value.

Remember that dateTime field values are stored as Coordinated Universal Time (UTC). When one of these values is returned in the Salesforce application, it is automatically adjusted for the timezone specified in your organization preferences. Your application may need to handle this conversion.

You can retrieve the current time zone using the UserInfo class.

TimeZone tz = 
  UserInfo.getTimeZone();
System.debug(
  'Display name: ' + 
  tz.getDisplayName());
System.debug(
  'ID: ' + 
  tz.getID());

You must log in to answer this question.

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