Token 6-1.11 has started to provide incorrect date/time tokens, but as we have been updating Date about every other day while our Token is untouched since early August, perhaps a newly introduced bug is causing Date to supply the bad dates. Issue #302808: Incorrect Timestamp may be related or the same problem.

We have a content type called "Bulletin" set up on D6.4 and CCK 6-2.dev which has a CCK Date field called pub_date, its granularity set to "day." The pub_date value is supplied via Token to Auto Nodetitle 6-1.0 ([field_pubdate-month] [field_pubdate-d], [field_pubdate-yyyy]) and Pathauto 6-1.1 ([field_pubdate-yyyy][field_pubdate-mm][field_pubdate-dd]).

Suppose I create a "Bulletin" with pub_date set to September 20, 2008. There are no errors, and when I edit the node, the pub_date remains set to September 20, 2008. But the auto_nodetitle has been set to "September 19, 2008" , and the path similarly has been saved as "20080919." This should not be a timezone or DST problem, as it was September 20 for both the site and server, configurable timezones are off, and anyway there is no timezone handling on the field when granularity is set to "day."

Incidentally, when configuring the CCK field, the time in the Default Display is twelve hours ahead of the site time. If that's not intentional, perhaps it is a clue.

We are using PHP 5.2.6.

Comments

bomarmonk’s picture

I think I am experiencing the same bug for token and date (the latest development version of date). I have a date field that only uses the year: 2008 (2009, etc.). When using this field as part of an automatic node title, I set the year to 2008, but the automatic node title returns 2007. If I put in 2009, I get 2008 returned by token and automatic nodetitle. Odd.

bomarmonk’s picture

Actually, I have this issue with both release candidate 3 and the latest development version.

jordanlewin’s picture

I am having the same issue, using 6.x-2.0-rc3. Using the token for the day of a Datestamp date [field_release_date-dd] with pathauto, the url alias it generates is one day behind what it should be. This is only for date fields, not other dates through the token module (the same token for a drupal core generated date, i.e. [dd] for the post date, works just fine).

jordanlewin’s picture

Another interesting bit is that it only seems to be happening for me on dates that don't have the time, i.e. where the granularity is set to day. So a CCK date on my Event content type that has the day and time shows up properly, while a CCK date for a release date on a Press Release content type with granularity set to day has this issue.

Moonshine’s picture

Status: Active » Closed (duplicate)

Let's fix this. :) Please see:

#313704: Date tokens returning earlier date