I had a CCK date field that was configured to take a date input in the format "dd/mm/yyyy", e.g. 16/10/2010 for 16th Oct 2010. As a result, I set up my CSV input file to also use this input format.
However, when I imported my records, not all the date fields were imported and I discovered that on line 60 of mappers/date.inc, strtotime() is used which assumes date formats using the / separator are american style mm/dd/yyyy and those using - separators are dd-mm-yyyy.
The fix was simple for me, just change my input format to something a bit less ambiguous (yyyy-mm-dd). However, I wonder how this is dealt with for external feeds/sources? Perhaps a note could be added to the documentation at the very least?
Thanks for an awesome module btw!
Comments
Comment #1
imclean commentedWe use
hook_feeds_after_parse()to convert dates from an external feed.However, it would be very handy to be able to configure the date format from within the Processor settings. Maybe it could use the Date API provided by the Date module.
Comment #2
dotman commentedin my csv, my dates are like this 2006-09-18, but after the import, their all set to today's date (or the date of import) like this 06/15/2011 - 20:06. How should I adjust my current published field so the the correct date is imported?
Comment #3
AniaMi commentedsubscribe
Comment #4
Abelito commentedUse this format: "D, d M Y H:i:s O" (Thu, 29 Mar 2012 18:03:49 -0700)Update: Use the Unix timestamp format: "U" (1333562099) Otherwise the timezone does not work.
http://us3.php.net/manual/en/function.date.php
I tried for hours to get it to work and finally!
Using: Feeds 6.x-1.0-beta11
and importing into the CCK field type "Datetime" using the Date module version 6.x-2.8
using a csv feed generated by another site.
Hope this helps someone else.
Comment #5
fprevos2 commentedI'm having this problem but I'm use a RSS feed, I can't control the input. Why isn't this module using the CCK date format that I specify?
I look at the patch for #831470: Import fails due to dates not converted correctly but it doesn't look like it fix the right problem since it already commit to the version I'm using.
Comment #6
twistor commented