15
votes
Is there a default TimeZone in which Date fields are stored in Salesforce?
I know this question is very old, but it comes up as one of the top results on google for Salesforce date timezone questions.
DateTime fields store the time information in UTC and display the ...
12
votes
Accepted
Day_Only in SOQL considering timezone
SOQL has a function called convertTimezone() that you can use in other date functions to return the value converted to the user's timezone:
Select Id From Case
Where Day_Only(convertTimezone(...
10
votes
Accepted
How can I query the supported timezones in Apex?
If you call TimeZone.getTimeZone with an invalid SID you get back the "GMT" time zone instance - this is one way to validate that your SID is supported (by checking that the SID for the object you get ...
7
votes
Changing data retention settings on existing data extension
You can change data retention settings for existing data extensions, even when they contain data. This can for sure be done in Contact Builder:
Just click on Edit under Data Retention, and change the ...
6
votes
Accepted
Formatting Time after clocks change
If the correct time zone to use when formatting all Site Guest User e-mails is British time, then choose British Summer Time (Europe/London) on that user account always. That should give you +00:00 in ...
6
votes
Accepted
What are all the timezones in SFMC?
I admit, that timezones in SFMC can be confusing. Especially since there is a number of different timezones applied - depending on the area of SFMC you are working with. Here is a good unofficial (...
5
votes
Accepted
Sending email based on Timezone of IP address
You can't send based on the recipient because you won't know what timezone the recipient will be in until they open the email.
If the subscriber has their timezone stored as a profile attribute/data ...
5
votes
Is the time-zone attribute broken in lightning-formatted-date-time?
@keith-c, thank you for your question. I work at Salesforce, and reviewed the component, and the documentation along with a colleague on the Docs team.
If you are setting the attribute time-zone=&...
4
votes
Accepted
Convert GMT time to IST using formula field
Your formula needs a modification .
When we do TEXT(DateTime) field SFDC converts the DateTime to TZ format which is in GMT .
Now to force GMT to IST we add +5.30 hours to the Datetime which can be ...
4
votes
Accepted
DateTime - Something not right!
The Date and Time objects are timezone agnostic; they neither carry nor honor timezone information. You can prove this with a simple script:
System.debug(
DateTime.newInstance(
Date.today(...
4
votes
Accepted
Business Hours and Time Zones (EDT vs EST?)
Set your timezone to GMT -4:00 Eastern Daylight Time (America/New York).
It will auto adjust for you as needed when set to that.
If you set it to Standard Time as you have it will not adjust for DST
4
votes
How to set datetime to be a specific time in a fixed timezone
EDIT: Robust Solution
This approach accounts for the issue that Autonomy brought up in the comments.
// We need 2 Datetimes to go between local and non-local
// - One Datetime which functions as ...
4
votes
Accepted
Time field based on TimeZone
The Time field type was created specifically to have a field that would be a time value independent of date. If your business hours are 08:00 - 18:00, regardless of the date, let's say, this is the ...
4
votes
Accepted
Why are Marketing Cloud timestamps not stored in the same timezone as Sales Cloud?
Yes this is expected. Server times for ExactTarget/Marketing Cloud is in CST: Central Standard Time (UTC minus six hours) and also the server time does not change with standard versus daylight savings ...
4
votes
Accepted
Dates appearing one day before the actual date
The problem is due to ui:outputDate. I think its showing date in UTC. Also, it is deprecated as of API version 47.0.
Consider using lightning:formattedDateTime instead of ui:outputDate.
With lightning:...
4
votes
Salesforce displaying Time custom field in GMT instead of User's timezone
All DateTimes in Salesforce are stored as GMT/UTC so that they can easily be shifted based on a user's timezone (a necessity in any organization where users are logging in from multiple time zones). ...
4
votes
Accepted
What is the best way to correctly create a string with a time queried from SOQL which needs to be displayed to Germans?
Simply use Salesforce's TimeZone class, and specifically the TimeZone.getOffset method.
You can probably do something like:
TimeZone germanyTZ = TimeZone.getTimeZone('Europe/Berlin');
System.debug(...
4
votes
How do i get the time zone of the device logged in as
I don't believe this is possible with Apex since it runs on the server it has limited access to the client's browser and configuration. However you can access this with standard browser APIs and some ...
4
votes
Accepted
Salesforce DataTable issue with timeZone of datetime field
The documentation for lightning-datatable mentions the following
The locale set in the Salesforce user preferences determines the default formatting for date and time types. The data table supports ...
4
votes
Accepted
Salesforce Time Zones
Wikipedia suggests that Indiana is split between eastern and central time, and that their observance of DST didn't take effect until 2006 (reference).
As some of the time standardization changes ...
3
votes
Accepted
Which users context will SOAP apex class execute in?
Ideally, you should only ever use GMT methods. Your application should convert all times to GMT, and your Apex Code should only use GMT. This removes all ambiguity, and helps make sure that you're ...
3
votes
Accepted
Due time calculated to be 19:00 instead of 18:00 when after 25/3
Some fun timezone facts: London's timezone is not really GMT. It's BST in the summer and GMT the rest of the year. GMT is the same as UTC. You can blame Scottish farmers for this, if you like.
So, ...
3
votes
Formula fields to display Current time based on Company Information
Unfortunately, the default Org Timezone is not available in the $Organization.xxx merge fields. Nor, incidentally, is it available on the Organization Object
Thus, to make this available to formulas, ...
3
votes
Accepted
Remove timezone conversion from the value of ui:inputDateTime
The Lightning Framework has a localization service that you can use in your JS to format date/time values which should be helpful to you with your issue.
// get currrent date/time and localize based ...
3
votes
Business Hours difference calculation during BST
All data is always stored in GMT (now referred to as UTC) regardless of what the local time is. Changing your data to local time to work with it can be dangerous when it comes to Daylight Savings ...
3
votes
Accepted
Storing DateTime and Timezone in a Text field
You can use a z in your format string to get the abbreviated time zone included in your output. For example,
System.debug(Datetime.now().format('MM/dd/yyyy hh:mm:ss a z', 'America/Chicago'));
...
3
votes
Accepted
Salesforce datetime field adding user timezone to the field
DateTime values are always stored in the database as GMT. They are always converted to the user's local time zone when being displayed. You need to convert the DateTime values in to GMT and go from ...
3
votes
Accepted
What is the system timezone in Marketing Cloud and does it consider DST?
Yes system timezone is in CST and the server time does not change with standard versus daylight savings time.
Why are Marketing Cloud timestamps not stored in the same timezone as Sales Cloud?
3
votes
Accepted
TimeZone.getTimeZone(tz) where String tz equals a supported (I think) timeZoneIdString throws 'Method does not exist or incorrect signature' error
What often will cause this sort of error is shadowing. It can look something like this:
String timezone = 'some value';
//...
Timezone tzone = Timezone.getTimezone('some name');
Or you might have ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
timezone × 175datetime × 87
apex × 60
marketing-cloud × 22
time × 16
date × 15
formula × 12
visualforce × 11
ampscript × 9
soql × 8
formula-field × 7
lightning-web-components × 6
businesshours × 6
lightning-aura-components × 4
trigger × 4
rest-api × 4
email × 4
force.com-sites × 4
event × 4
locale × 4
lightning × 3
workflow × 3
lightning-datatable × 3
string × 3
calendar × 3