Date issue when migrating with Salesforce Data Loader

by Niklas Waller on June 2, 2009

in Cloud computing,Salesforce

When migrating from a source system to Salesforce using the Apex Data Loader a date becomes the date it was minus 1 day. This happens for all of my objects that contains a date.

The source system is MySQL but the data originally comes from Lotus Notes.

Example:
We are migrating customer information into an Account. In MySQL a query generates x rows where a specific date is one of the field values. The rows are via the Data Loader migrated into an Account using upsert.

Row in MySQL
Company name Customer start date Category
Company A 2009-04-23 A
Corresponding values in Salesforce after migration
Company name Customer start date Category
Company A 2009-04-22 A

Since this causes problems of different kinds for example when creating reports and just the fact that we get wrong data in the system I would like to have it fixed. Anyone know of a simple explanation?

During our discussion internally we were thinking that it might be a time zone issue between Sweden and America. I have asked Salesforce for an explanation and I will update this post when I get it.

Update:
I got an answer from Salesforce with an explanation on why it works the way it does regarding the above issue.

The DataLoader is running on Java which uses the installed machines default time zone. In Salesforce Dates need to be imported in GMT so that dates will not appear a day out.
Dates need to be loaded with a GMT time component in the following format: YYYY-MM-DDT00:00:00.000Z, e.g. for 18 July 2009 => 2009-07-18T00:00:00.000Z

Share and Enjoy:

  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • email
  • Google Buzz
  • RSS
  • Slashdot
  • Technorati
  • Add to favorites
  • DZone
  • LinkedIn
  • MySpace
  • Tumblr

Related posts:

  1. Jitterbit Data Loader for Salesforce
  2. Two ways of logging in with Salesforce Data Loader
  3. Data Loader CLIq
  4. Migrating from Lotus Notes
  5. Backing up your Salesforce data

{ 13 comments… read them below or add one }

Hemant Solanki September 2, 2009 at 15:41

Hi…
I m getting same error……while importing data using Apex Data Loader, Can please tell me in detail what I have to do next…
Please Help…….

Reply

Hemant Solanki September 6, 2009 at 09:56

hi Niklas
I tried option 1. I changed date format in my csv file into ISO YYYY-MM-DDT00:00:00.000Z, but still I am getting same result………will I have to change format any other place……

Reply

Frank October 13, 2009 at 11:39

Great help – thanks.

Reply

Colin November 17, 2009 at 12:42

Also running this in Daylight Saving (before Oct 25, 2009) hours seemed to make a one hour difference and put the dates back a day, if you used YYYY-MM-DDT01:00:00.000Z all would be well again (ie. 1AM on the date in question).
Now, as we are out of Daylight Saving hours again plain old YYYY-MM-DDT00:00:00.000Z should work again.

Reply

manish January 19, 2010 at 13:51

Please suggest how to import old dates in salesforce created date field using data loader because it is taking the sales force default created date . i want to overwrite the created date field by the one i m having in the csv

Reply

Pardeep Chadha March 24, 2010 at 11:49

Manish,
For Importing the legacy created date into sfdc Audit field ‘CreatedDate’, You have to enable ‘Create Audit Fields’ on your Org

Reply

Niklas Waller September 2, 2009 at 18:43

Hi Hermant,
As I see it you have two options:

1. Import dates the way suggested by Salesforce which were explained in the update above, i.e. on the format YYYY-MM-DDT00:00:00.000Z, e.g. for 18 July 2009 => 2009-07-18T00:00:00.000Z

2. Manipulate the dates you are using to current date plus one day.

But I would definately recommend option 1.

Do you have the possibility to manipulate the data before importing it with the data loader in a good way?

Reply

Manish Thaduri October 30, 2010 at 22:22

Doods,

Downgrade your Apex data loader version to 19.0. No dates issue!! :)

In the new version (20.0), in the setting menu, there is an extra option ‘TimeZone’. That makes the difference :)

Haffunnn

Reply

Niklas Waller February 23, 2011 at 10:27

That’s a good one Manish!

Reply

saikrishna July 29, 2011 at 21:05

Thanks, I changed the format of the date and it worked fine.

Reply

amine el September 30, 2011 at 10:22

Hi saikrishna ,

How did you changed the fomat of the date ?

thanks,

Reply

Chris September 22, 2011 at 05:58

Thank you very much Manish, that was the detail no one else mentioned. Even with the correct format, the Timezone setting will make the date incorrect!

Reply

Anil October 21, 2011 at 12:52

Hi Manish..

There is another major date issue with any version of apex data loader.
If DD/MM/YYYY is the format in the csv file, then the date loaded in salesforce is unbelievably different…! Ex: 26/10/2011 is the date in my csv file and the date is loaded in salesforce as- 2/10/2013 .. what makes such a huge difference??? Is it like csv file doesn’t support this date format? pls respond..

Regards,
Anil

Reply

Leave a Comment

Previous post:

Next post: