Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Import csv with different date format


Go to End


1180 Views

Avatar
sajok

Community Member, 82 Posts

12 June 2013 at 1:40pm

Edited: 12/06/2013 1:41pm

Hello,

I have a csv file with various columns including a date column with the format MM/DD/YY. When I upload this file through Model Admin interface, all field values are saved correctly except the date field which is saved as 1969/12/31. I have extended the CsvBulkLoader class to associate csv columns with the table fields, and I have added " i18n::set_date_format('MM/dd/YYYY');" to the _config.php file, but still it accepts only this format: DD/MM/YYYY.

any help on how to import and save the date format in the csv file which is MM/DD/YY instead of the default.

Thanks