What's the date format for the Apex Data Loader? - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Lori AndersonLori Anderson 

What's the date format for the Apex Data Loader?

I'm trying to query off of Last Modified Date and I've tried two different formats and got unsatisfactory results. I want to look at Tasks where the Last Modified Date was prior to August 1, 2009.

I tried putting the date in these two formats:
* 08/01/2009
* 2009-08-01

Neither one works as expected. I can't find documentation on the Data Loader to help me. Can anyone help?

Thanks.
Best Answer chosen by Moderator (salesforce.com) 
Carmen HymesCarmen Hymes
 I hope this response isn't coming too late, but I struggled with this as well.  The Apex data loader allows you SOQL statements to pull data - therefore you have to use date formats that SOQL statements will use.

here's a quick example, but there are so many options, you should really check out the guide.  I included a link under my example:

FormatFormat SyntaxExample
Date onlyYYYY-MM-DD1999-01-01
Date, time, and time zone offset
  • YYYY-MM-DDThh:mm:ss+hh:mm
  • YYYY-MM-DDThh:mm:ss-hh:mm
  • YYYY-MM-DDThh:mm:ssZ
  • 1999-01-01T23:01:01+01:00
  • 1999-01-01T23:01:01-08:00
  • 1999-01-01T23:01:01Z

here's a link to the guide: http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_soql.htm

All Answers

Mark PassovoyMark Passovoy
Try 2009/08/01 or you can turn on European date format in the settings of the Data Loader.
Carmen HymesCarmen Hymes
 I hope this response isn't coming too late, but I struggled with this as well.  The Apex data loader allows you SOQL statements to pull data - therefore you have to use date formats that SOQL statements will use.

here's a quick example, but there are so many options, you should really check out the guide.  I included a link under my example:

FormatFormat SyntaxExample
Date onlyYYYY-MM-DD1999-01-01
Date, time, and time zone offset
  • YYYY-MM-DDThh:mm:ss+hh:mm
  • YYYY-MM-DDThh:mm:ss-hh:mm
  • YYYY-MM-DDThh:mm:ssZ
  • 1999-01-01T23:01:01+01:00
  • 1999-01-01T23:01:01-08:00
  • 1999-01-01T23:01:01Z

here's a link to the guide: http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_soql.htm
This was selected as the best answer
Carmen HymesCarmen Hymes
 I hope this response isn't coming too late, but I struggled with this as well.  The Apex data loader allows you SOQL statements to pull data - therefore you have to use date formats that SOQL statements will use.

here's a quick example, but there are so many options, you should really check out the guide.  I included a link under my example:

FormatFormat SyntaxExample
Date onlyYYYY-MM-DD1999-01-01
Date, time, and time zone offset
  • YYYY-MM-DDThh:mm:ss+hh:mm
  • YYYY-MM-DDThh:mm:ss-hh:mm
  • YYYY-MM-DDThh:mm:ssZ
  • 1999-01-01T23:01:01+01:00
  • 1999-01-01T23:01:01-08:00
  • 1999-01-01T23:01:01Z

here's a link to the guide: http://www.salesforce.com/us/developer/docs/api/index_Left.htm#StartTopic=Content/sforce_api_calls_soql.htm
Karthik DupakuntlaKarthik Dupakuntla
Date format 'Data Loader' uses is set on your laptop.  Go to 'Regional Settings' under 'Control Panel' ensure you select correct country/languge and alter date format as appropriate.  This should be the first step before using data loader.
Nathan PepperNathan Pepper
Karthik got it partially right.... It does take your COMPUTER's locale into consideration, but only for non ISO 8601 format.  I continually got errors when trying to use the ISO 8601 Date format used by Salesforce (yyyy-MM-ddThh:mm:ssZ) because (as it says on page 9 of the Data Loader Guide PDF) the format should be: yyyy-MM-dd'T'HH:mm:ss.SSS'Z'

Minor difference that matters a lot! :-)
http://www.salesforce.com/us/developer/docs/dataLoader/index_Left.htm#StartTopic=Content/supported_data_types.htm

Johan YuJohan Yu
Sharing a blog related to this http://bit.ly/SFDataLoader
anusha canusha c
https://anusalesforce.blogspot.in/
Eliana BettioEliana Bettio
Thank you very much for this thread
Logan LidsterLogan Lidster

This question is old, but still gets asked. If you are loading data from Excel, you MUST change the text of the date, not just the format (format only changes how you see it, the value is still the same). Do NOT go to custom formate and add YYYY-MM-DD.
Add a column next to the date and use a text formula to convert the value to a text value. If your date is in B2 as 12/25/2016 in cell C2 add =TEXT(B2,"YYYY-MM-DD"). This will actually change the value in the cell, not just the formate.
Last step - COPY all of column C and PASTE as "text". After this, you should only see the date in C2, not a formula. Now you can delete Column B and use C to import your date with Data Loader.

Michael SchnieppMichael Schniepp
Thank you Logan! this is exactly what I needed...I did exactly what you mentioned with a custom format and failed. 
Johan YuJohan Yu

As long as you see the date in the format of YYYY-MM-DD in CSV file, using a text editor, it should be fine, it doesn't matter it is by formula or by cell format.