I have created a CCK Date field in a content type. I'm calling this new field "month". Its granularity is set as Year, Month. Data seems to be stored properly, because when viewing and editing a node, this date field displays the same year and month that I entered.

However, when I use a token, the previous month is used for replacement. A couple of examples:

I'm using these tokens in autonodetitle for date and year, coming from the Date CCK field:
[field_month-month] [field_month-yyyy]
I have entered Jan 2009 as the month field. Then "December 2008" gets inserted into the title, to replace the tokens.

I'm using these tokens as part of the filepath (made available by filefield_path module):
my-files/[field_month-yyyy]-[field_month-mm]
After entering Jan 2009 as the month, the filefield becomes this:
my-files/2008-12

Or if I enter Apr 2008, the path becomes my-files/2008-03

Comments

juliekj’s picture

Did you ever figure this out, I'm having the same problem, only with Year (Y).

I enter 2000, but when it displays on the view of the node it says 1999. When I go to edit, it's entered as correct...

Have no idea where to look for the problem..??

nadavoid’s picture

No, I haven't figured this problem out yet. (For my specific use case, I ended up creating two simple dropdown lists containing numbers, instead of using a date field.)

My guess is that the issue is somewhere in how token gets the date value from the date field, or how the date field exposes its values to token.

dave reid’s picture

Project: Token » Content Construction Kit (CCK)
Version: 6.x-1.11 » 6.x-2.6
Component: Code » Token Integration

CCK tokens are provided by cck.module, not token.module. Transferring to the CCK issue queue.

agileware’s picture

Project: Content Construction Kit (CCK) » Date
Version: 6.x-2.6 » 6.x-2.4
Component: Token Integration » Code

CCK only provides tokens for its own field types.

The date module handles date field tokens.

arlinsandbulte’s picture

Version: 6.x-2.4 » 6.x-2.6
Status: Active » Closed (cannot reproduce)

I tested and could not reproduce this with date 6.x-2.6.

One possibility:
How do you have your timezone settings configured?
Site Timezone setting
User Timezone setting
Field Timezone handling (should be "no timezone conversion" if your granularity is set to month or day).