0

The external System updates the date time field as 2021-03-15T09:00:00.000+0000. When I query the SOQL is also returning the same value. But when EST time zone user logins, the record suppose to show 4 AM instead it is showing 5 AM.

2021-03-15T09:00:00.000+0000(9 AM UTC) is 4 AM EST. But for any time zone user the field value in UI is showing one hour more. Any reason ?

1

Sunday, March 14th, 2021 is the Daylight Savings Time transition time. During this time, many time zones go forward one hour. As such, EST becomes EDT, changing from UTC-05:00 to UTC-04:00. 09:00 minus 04:00 is 05:00, which is the time you're getting in the UI. In general, DST transitions occur on a Sunday in Spring and Fall. You should consult with a time zone database to check when DST will occur for each year. It's also worth noting that some time zones do not change during the year, which is a part of the confusion when dealing with time zones.

1
  • To add to sfdcfox's point, you can hardly ever look at the TZ DIFF based on todays TZ DIFF, you always have to look at it for that exact Date and Time of that TZ. – NZ Dev Mar 5 at 4:48
1

Answer: Because the UI is Correct :)

Salesforce is one of the best platforms for DateTime Management. But humans are not. DateTimes are inherantly difficult to perceive. And hence coded solutions should be carefully reviewed before deployed, and data entry is allowed. Otherwise a huge data migration could be your next big project.

you may have been applying todays TZ diff, you need to apply the exact DT of the DT being calculated.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.