I have a date field as a select list with month and year. When the node is saved, the date is stored as a month earlier than entered. I thought that maybe the time zone settings were affecting things, but no matter what timezone options I choose, I can't seem to fix this problem.

BTW, it's great that date works in views now.

Comments

KarenS’s picture

I just posted changes to cvs to clean up timezone handling, and these changes may (hopefully) also fix this problem. Can you try the latest cvs version and see if the problem remains?

patrickharris’s picture

Unfortunately the changes don't seem to help. If I store a month and year, it is still saved as the previous month. I didn't reinstall the whole module though - should this be necessary because of the changes to date.install?

KarenS’s picture

I don't think the date install changes are a factor. I can't replicate your problem -- months are working fine for me -- so I need as much info as you can provide so I can duplicate your situation:

* what type of date are you creating (iso or timestamp)
* what widget are you using
* what granularity options did you choose
* what timezone handling did you select
* what timezone are you using for the above tz handling
* what date are you trying to create
* are you creating a date in a new node or using a node that existed before you started using the date module
* are you creating a new date or updating an existing date

KarenS’s picture

Just to be clear, you are using the latest version of date.inc, right? That's the one with the timezone changes.

patrickharris’s picture

Yes, the latest version. I'll uninstall date, remove the tables, reinstall, and see if the problem happens again.

patrickharris’s picture

I'm choose "Fieldtype -> Date -> Select list". So the widget is a select list, granularity is year/month, all other options left alone. For timezone I tried about 6 different ones, and for time zone handling I experimented with "no handling" and "gmt".

Even on a fresh install of drupal, I still get this error, even with a brand new cck, new content, inserting a new date. If I update a node, and leave the value as is, it will always subtract one month. The dates I am trying to insert are "Jun 1928", but it happens the same for any date, even "Jun 2006".

Strange you can't duplicate it. Maybe it has something to do with php5 that I'm using?

KarenS’s picture

I'm not completely surprised I didn't run into this. With all the selectors, date types, granularity options, timezone options etc there are so many combinations I couldn't possibly test all of them :-)

Anyway, now I have something specific to test. I'll get back to you on this.

KarenS’s picture

OK, found the problem and I'm working on a fix. It is because you didn't provide a day. That is supposed to be allowable, but the program was trying to make it into a 'real' date and ended up creating a value for the last day of the previous month. Obviously I have to fix the logic :-)

I'll get something posted soon, hopefully.

KarenS’s picture

Status: Active » Fixed

I just committed changes to the cvs version of date.inc that should fix this problem. Reopen if they don't work.

Anonymous’s picture

Status: Fixed » Closed (fixed)