Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

Why is the salesforce datetime format different in the UI and DB?

Asked by David Edmunds May 15, 2023 1.0K views 1 answer
Share

About this question

Why is there a datetime format so different as compared to what I see in the UI vs SOQL/APEX and I can not figure out what is going on. Can anybody please explain what I'm doing wrong here?

In the UI this is what I see:
5/27/2021 6:30 AM
and when I query I see this:
2021-05-27T11:30:00.000+0000
when I ran the apex code I see this:
2021-05-27 11:30:00
String data = '2021-05-27T11:30:00.000+0000'; Datetime dt = (DateTime)JSON.deserialize('"' + data + '"', DateTime.class); system.debug( dt);

My question, why is it not showing what is in the UI?

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.