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
Sarav MSarav M 

SF DateTime Field is Saving in GMT Format

I have datetime field in salesforce.
When i assign the value of '2008-11-26 17:24:24" it saves it as "11/26/2008 9:24 AM".  I don't want this conversion, what should i do?
Park Walker (TAGL)Park Walker (TAGL)
You'll want to convert your DateTime value to GMT prior to saving it, and convert values retrieved from the system to the user's local time before displaying.

Salesforce.com is designed to serve a worldwide audience and many customers have users in many time zones. That's why values are stored in GMT.

Park
RajeevKumarRajeevKumar
use this format
CONVERT(VARCHAR(23),cast(DATEADD(hh,8,a.LeadGenDateTime) as datetime), 126)+'-00:00'