I think the section on "Date's time zone" is wrong at http://drupal.org/node/1455578

I would edit the page myself but I don't know what the intended behavior is. The page says "When the date is saved to the database, it is not converted & the time zone information is saved with the date. When retrieved from the database, no conversion is performed and the date is displayed exactly as entered."
In fact it looks to me like some conversion is performed, but I don't understand the rationale behind the conversion. On my site I entered 18:30 for the start date of an event, but if I dump the data I see...

["value"]=> string(19) "2012-08-07 23:30:00"

Whereas if I set a date field to "No time zone conversion" and enter 18:30, I get...

["value"]=> string(19) "2012-08-07 18:30:00"

So it appears to me that the documentation is correct for the "No time zone conversion" section, but not the "Date's time zone" section.


coredumperror’s picture

Issue summary: View changes

I believe the problem here is that the Date code doesn't call the date_get_timezone_db() function properly (and the current version of that function, without my patch from comment #7 on #998076: Problem with timezone handling (caused by date_get_timezone_db returning only UTC) , doesn't work right anyway). Someone will need to go through the code to find all the places this function gets called and ensure that the $timezone parameter is always passed in when the $handling parameter is 'date'.