I'm trying to import a date into a node field. The node field is formatted as a date field and has "customize input format" set to Y-m-d. Similarly, my csv file I'm importing has dates set in the format of 2012-04-18.

However, after I import and look at the data, for some reason it shows up as 2012-04-17...This is absolutely mind boggling to me. I checked about 5 of the created nodes from my csv file that contains 2403 records, and all of them had the imported date with the day one less than what was imported. Even a date imported as 2011-12-01 showed up as 2011-11-30!

Comments

hanno’s picture

Probably a timezone setting issue for your date field as the time of a date without time is handled as 00:00 -timezone. Did you experience with the timezone settings?

hanno’s picture

Category: bug » support
franz’s picture

If you have trouble with timezone, you might want to use Feeds Tamper plugin "String to Unix timestamp".

franz’s picture

Status: Active » Postponed (maintainer needs more info)
RyFo18’s picture

StatusFileSize
new19.94 KB
new25.38 KB
new24.42 KB
new22.41 KB

For my date field, I have the granularity selected as Year, Month, Day. I have tried to have Time Zone Handling set to "Site's Time Zone", however, when I do this the following error occurs:

Dates without hours granularity must not use any timezone handling.

I went a step further and recreated the field with a granularity of Year, Month, Day, Hours, Minutes, Seconds so I could set the handling to "Site's Time Zone". Unfortunately, it still imports as a day earlier!

I've uploaded 4 screenshots showing my settings. Two of them show the field settings for my Date field. The third picture shows the feeds importer setting, and the fourth is a screenshot of my node being displayed after the import. Note that I also import this same date field to the title using a feeds tamper, so you can in fact see that the imported date is 2003-09-07, while the displayed date is September 6, 2003.

I am also convinced that this probably has to do with Timezone handling, but I'm not sure what else to try.

RyFo18’s picture

UPDATE

So it looks like I got it to work (kind of). I also realized that in another field that imports time, I was getting the incorrect time.

I tried to import as "Site's Time Zone" and this was not working. When I switched to UTC, that worked, though I'm not sure why. Any insight?

So for my date field, I added "Hours" to the granularity so that I could select UTC (since you can't do timezone handling without hours as the granularity). The date shows up correctly...I have the date set to display like this though:

September 7, 2003

When I add the hours granularity it shows up as:

September 7, 2003 (All-Day)

I can't really figure out how to get rid of this (All-Day) thing. Probably not a Feeds issue, but worth asking here.

hanno’s picture

RyFo18’s picture

Thanks for the suggestions. In the end, I used Feeds Tamper to "rewrite string to UNIX timestamp" and that seemed to get all of my dates in correctly.

RyFo18’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)