0

I have a csv with a Date field that contains the date in one of the following formats:

  • dd/mm/yy (ex. 13/11/04)
  • dd/mm/yyyy (ex. 13/11/2004)

I need to import these dates to my field in the format dd-mm-yyyy, using feeds.

I've tried everything but without success. I have my date field set with my custom date format (dd-mm-yyyy).

What do I need to do in feeds (or even feeds tamper) to import this data?

Thanks.

0

The date itself typically is stored in the mysql database as a timestamp or datetime format, depending on the configuration when you setup the field.

To ensure the Feeds' built-in date mapper importer processes the dates properly, I recommend:

  1. open the CSV as a spreadsheet
  2. reformat the date column to be an integer timestamp field
  3. Resaved the csv with the numeric value for the date rather than the formatted value.
  4. Update your feed importer mapping for the revised date field/column data from the CSV.
  5. Run the import.

Alternatively, the Feeds Tamper module may be used to parse the date parts from a string formatted date in your Csv, and then join them as needed into a properly formatted date entry; but it would still require a consistent format in the csv. (you need either two or four-digit years in all the dates)

  • I don't have write access to the csv (I'm importing externally). Anyway, I solved my problem with Feeds Tamper and the PHP plugin. I know it's not the cleaner solution but it was the only one that solved my problem. – zephirus Aug 29 '18 at 14:18

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.