I've object with date field, and excel file with data to import. one of the fields found on excel is delivery date 1/10/2015 17:28 (day/month/year time). Now when I import to target object it's imported as 10/01/2015 (day/month/year)

what is the best way to handle this issue before save the record. because saving record means invalid date value

  • How are you importing the file? – sfdcfox Oct 7 '15 at 17:23
  • I use dataloader @sfdcfox – user3003810 Oct 7 '15 at 17:25

The data loader requires that the fields are formatted correctly, as outlined here. Here's the list:

yyyy-MM-dd'T'HH:mm:ss.SSS Pacific Standard Time
yyyy-MM-dd'T'HH:mm:ss.SSSPacific Standard Time
yyyy-MM-dd'T'HH:mm:ss.SSS PST
yyyy-MM-dd'T'HH:mm:ss.SSS GMT-08:00
yyyy-MM-dd'T'HH:mm:ss.SSS -800
yyyy-MM-dd HH:mm:ss
MM/dd/yyyy HH:mm:ss

You can format the column in Excel before using Ctrl-1 (Format Cells), then choosing the appropriate date format (YYYY-MM-DD); when you save the CSV file, they will retain the correct formatting.

If you're seeing the dates "backwards", check your "locale" under "Your Name" > My Settings > Language & Time Zone (new User Interface), or under Setup > My Personal Information > Personal Information (classic User Interface, or with Sites). If you're using a locale like UK, the date will be DD-MM-YYYY, while if you use the US locale (and some others), it will be MM-DD-YYYY. I suspect your account was simply set up with the wrong locale.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.