function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sushil Kumar VermaSushil Kumar Verma 

Showing different DateTime on the detail page and when we are fetching records via SOQL:

Showing different DateTime on the detail page and when we are fetching records via SOQL:
1. Create a record like a task object record
2. open task detail page and check created date
3. open the developer console and do SOQL on created task with created date
David Zhu 🔥David Zhu 🔥
SOQL in developer console returns GMT. Hope this helps
SwethaSwetha (Salesforce Developers) 
HI Sushil,

I was able to replicate this behavior creating a Task. The developer console/Workbench show DateTime in GMT format whereas the record shows time in IST timezone(my locale time).

This is how it was designed for all the Salesforce orgs. When you are displaying the same in the UI, it will be converted to the user locale, but if you are accessing it through the code, then you need to convert it as per your requirement.

This would be difficult to store values in the backend depending on org level or user level locale and some orgs might contain wide ranges of user locales and that is the reason for the uniformity, it is stored in GMT format.

More info: https://salesforce.stackexchange.com/questions/29823/clarification-about-timezone-conversion-in-datetime

Please consider submitting your ask as an idea on Idea exchange so that the product team can implement it in coming releases based on the number of upvotes. 
Link: https://success.salesforce.com/ideasearch
 
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.
 
Thank you