![](https://www.infallibletechie.com/wp-content/uploads/2023/01/Query-DateTime-field-in-Salesforce-1024x576.jpg)
Salesforce stores the DateTime in GMT/UTC.
Below SOQL will give the number of accounts that were created between 5 PM to 5.15 PM EST.
Since EST is +5 from GMT, 12 + 5 + 5 = 22 is used in the query.
Sample SOQL:
SELECT COUNT( Id ) FROM Account
WHERE CreatedDate >= 2019-03-04T22:00:00Z AND CreatedDate <= 2019-03-04T22:15:00Z
Output:
![](https://www.infallibletechie.com/wp-content/uploads/2019/03/SOQL2BDate2BTime2Bin2BSalesforce.png)
Sample Query:
SELECT Id, LastModifiedDate, SystemModStamp
FROM Account
WHERE SystemModStamp = TODAY ORDER BY SystemModStamp DESC LIMIT 5
![](https://www.infallibletechie.com/wp-content/uploads/2019/03/Date2BTime2BSOQL.jpg)