I am running date-5.x-1.8 on drupal 5.7 w/mysql 5.0.45, PHP 5.2.3 and have added the date and date_api modules. I created a new node type and added a date field with only m-d-Y configured and with select box option. I have only a local timezone of Los Angeles and no timezone offset. The day of the month is written as the entered value - 1 into the database as confirmed in the content_type_xxx table.

I attempted to store a full date/time including HM and get an offset of 8 hours (earlier) stored in the database.
I get the same results if I store as a strtotime/text field as well.

I did not see anything in the issues directly related to this and wasn't sure if this was a know bug or issue with newer versions of drupal or mysql/php?

Comments

muriqui’s picture

+1 on this. Strangely, this only seems to affect certain times of the day. I have a datestamp field in a custom node type with granularity set to the minute and time zone of America/Detroit. Today (2008-03-08) I tried to create a new node with a datestamp of "2008-03-08 22:16" and it saved into the database as "2008-03-09 00:16" I originally had all parts of the datestamp field set to use select boxes, but tried changing these to a text field with strtotime validation and got the same bad result. However, if I changed the datestamp on this same node to "2008-03-08 20:16," it saved correctly into the database.

I also noticed that this bug is affecting the "configure field" form under "Manage fields" on the node type. I browsed to the form at 2008-03-08 22:54, and in the "Date display" drop-down under "Default display," it showed "2008-03-09 03:52," whereas normally this field displays the current site date and time. I double-checked, and my site's time (as shown under Site Configuration) was correct... It's only in the Date module's forms that the incorrect future date is shown.

Yura Filimonov’s picture

Not sure if this is related to the date CCK field, but I am having the same problem:
the nodes are created with future dates, sometimes off by 10 days.

Anyone tracked this bug down?

KarenS’s picture

The 5.1 version has lots of quirky bugs like this. I'm not fixing the 5.1 version any more because the date and timezone handling in the 5.2 version is totally reworked and much improved. It's almost production-ready, and although it's not bug-free it's probably better than 5.1 at this point, so you might want to try that. When you update from 5.1 to 5.2, be sure to empty your date folder out since the files are all moved around.

KarenS’s picture

Status: Active » Closed (won't fix)

I'm not making changes to the 5.1 version. I'm officially recommending you move to the 5.2 version now. If you have problems in that version you can check for existing issues or add new ones. Feature requests are now getting posted to the D6 version to be back-ported to 5.2.