Data Loader,Salesforce Import date/datetime field with correct date/time value using data loader.

Import date/datetime field with correct date/time value using data loader.

Users always face issue in importing date or datetime fields in salesforce. Sometime they face format issue or increase/decrease in date and time after importing the record.

Best way to get the valid format is to take export of any existing record containing date time value. Possible formats are:

YYYY-MM-DD — For date only
YYYY-MM-DD hh:mm:ss — For date as well as datetime
YYYY-MM-DD hh:mm:ss — For date as well as datetime
YYYY-MM-DDThh:mm:ssZ — For date as well as datetime
YYYY-MM-DDThh:mm:ss.sssZ — For date as well as datetime

Assuming 2017-12-04T18:00:00.000Z is in GMT timezone, which is 6pm and user having time zone ‘(GMT-05:00) Eastern Standard Time (America/New_York)’ i.e. actual time is -5 hr to the GMT time. After data import, this will be saved in database as 12/04/2017 1pm i.e. -5 hrs from GMT time.

To fix this either increase the time of record to 5 hr. and then import the data or change the user timezone to ‘(GMT+00:00) Greenwich Mean Time (GMT)’.

To change the timezone

  1. Goto setup area.
  2. On left hand side search box search for ‘User’, and then click on User link.
  3. This will list all user. Click on required user and then edit the record.
  4. On the edit screen, change the ‘Time Zone’ field value to ‘(GMT+00:00) Greenwich Mean Time (GMT)’ and save the record.

Leave a Reply

Your email address will not be published. Required fields are marked *