When the Event module (6.x-2.x-dev) is enabled, the time settings for the system are incorrect.

My server is set to CST. Default time zone for Drupal is set to America/Chicago (when Event enabled). User time zones are disabled and set to NULL in the database. Posts, log entries, etc. all show current time +5 hours.

$ uname -a
Linux xxx.com 2.6.23.15-80.fc7 #1 SMP Sun Feb 10 17:29:10 EST 2008 i686 i686 i386 GNU/Linux

$ date
Wed Feb 27 09:13:47 CST 2008

Comments

sstern-at-ccim’s picture

ping.... This is still an issue. I reenabled events and now all system times are screwy. I cannot find any setting that properly displays US/Central or America/Chicago

sstern-at-ccim’s picture

The error appears to be in the installation code. Here's what's supposed to be installed for America/Chicago:

grep Chicago *
event.install:    58 => array('timezone' => 'America/Chicago', 'offset' => '-6:00:00', 'offset_dst' => '-5:00:00', 'dst_region' => '15'),
event.install:t('America/Chicago') 

But the offset and offset_dst fields in the database are both set to "0000-00-00 00:00:00"

Should the database field really be a "datetime" field? Browsing through the table, I see all sorts of very strange values. The insert statement converts "-6:00:00" to an all zero value.

UPDATE `event_timezones` SET `offset` = '-5' WHERE `timezone` = 58 LIMIT 1;

results in

0000-00-00 00:00:00

There is no way to set a negative number!

I modified the table to change offset and offset_dst from datetime to int and put in the appropriate values for Chicago (-6, -5) and now the system displays the correct time.

erikwebb’s picture

I have the exact problem. It took me days to figure out that all times were screwy because the entire event_timezones table contains, essentially, junk.

Here is an example of some values after altering the offset and offset_dst to be integers:

mysql> select * from event_timezones where name like 'US%';
+----------+-------------------+--------+------------+------------+--------+
| timezone | name              | offset | offset_dst | dst_region | is_dst |
+----------+-------------------+--------+------------+------------+--------+
|      474 | US/Alaska         |      0 |          0 |         15 |      0 | 
|      475 | US/Aleutian       |      0 |          0 |         15 |      0 | 
|      476 | US/Arizona        |      0 |          0 |          0 |      0 | 
|      477 | US/Central        |      0 |          0 |         15 |      0 | 
|      478 | US/East-Indiana   |      0 |          0 |          0 |      0 | 
|      479 | US/Eastern        |      0 |          0 |         15 |      0 | 
|      480 | US/Hawaii         |      0 |          0 |          0 |      0 | 
|      481 | US/Indiana-Starke |      0 |          0 |          0 |      0 | 
|      482 | US/Michigan       |      0 |          0 |         15 |      0 | 
|      483 | US/Mountain       |      0 |          0 |         15 |      0 | 
|      484 | US/Pacific        |      0 |          0 |         15 |      0 | 
|      485 | US/Samoa          |      0 |          0 |          0 |      0 | 
+----------+-------------------+--------+------------+------------+--------+
12 rows in set (0.00 sec)

Or as an example of screwy values (again, after the modify column statement):

mysql> select * from event_timezones where name like 'Pacific/Au%';
+----------+------------------+--------+------------+------------+--------+
| timezone | name             | offset | offset_dst | dst_region | is_dst |
+----------+------------------+--------+------------+------------+--------+
|      416 | Pacific/Auckland |   2013 |       2012 |         15 |      0 | 
+----------+------------------+--------+------------+------------+--------+
1 row in set (0.00 sec)
killes@www.drop.org’s picture

#213822 was marked a duplicate of this issue

killes@www.drop.org’s picture

UPDATE `event_timezones` SET `offset` = '-5:00:00' WHERE `timezone` = 58 LIMIT 1;

This works fine for me on Linux. Can I assume you guys run Windows?

@erikwebb: Of course the table contains junk after you change it's definition to values they aren't supposed to have...

erikwebb’s picture

You're right, but the values before were equally as screwy:

mysql> select * from event_timezones where name like 'Pacific/%';
+----------+--------------------------------------------+---------------------+---------------------+------------+--------+
| timezone | name                                       | offset              | offset_dst          | dst_region | is_dst |
+----------+--------------------------------------------+---------------------+---------------------+------------+--------+
|      415 | Pacific/Apia                               | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      416 | Pacific/Auckland                           | 2013-00-00 00:00:00 | 2012-00-00 00:00:00 |         15 |      0 | 
|      417 | Pacific/Chatham                            | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |         15 |      0 | 
|      418 | Pacific/Easter                             | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      419 | Pacific/Efate                              | 2011-00-00 00:00:00 | 2011-00-00 00:00:00 |          0 |      0 | 
|      420 | Pacific/Enderbury                          | 2013-00-00 00:00:00 | 2013-00-00 00:00:00 |          0 |      0 | 
|      421 | Pacific/Fakaofo                            | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      422 | Pacific/Fiji                               | 2012-00-00 00:00:00 | 2012-00-00 00:00:00 |          0 |      0 | 
|      423 | Pacific/Funafuti                           | 2012-00-00 00:00:00 | 2012-00-00 00:00:00 |          0 |      0 | 
|      424 | Pacific/Galapagos                          | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      425 | Pacific/Gambier                            | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      426 | Pacific/Guadalcanal                        | 2011-00-00 00:00:00 | 2011-00-00 00:00:00 |          0 |      0 | 
|      427 | Pacific/Guam                               | 2010-00-00 00:00:00 | 2010-00-00 00:00:00 |          0 |      0 | 
|      428 | Pacific/Honolulu                           | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      429 | Pacific/Johnston                           | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      430 | Pacific/Kiritimati                         | 2014-00-00 00:00:00 | 2014-00-00 00:00:00 |          0 |      0 | 
|      431 | Pacific/Kosrae                             | 2011-00-00 00:00:00 | 2011-00-00 00:00:00 |          0 |      0 | 
|      432 | Pacific/Kwajalein                          | 2012-00-00 00:00:00 | 2012-00-00 00:00:00 |          0 |      0 | 
|      433 | Pacific/Majuro                             | 2012-00-00 00:00:00 | 2012-00-00 00:00:00 |          0 |      0 | 
|      434 | Pacific/Marquesas                          | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      435 | Pacific/Midway                             | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      436 | Pacific/Nauru                              | 2012-00-00 00:00:00 | 2012-00-00 00:00:00 |          0 |      0 | 
|      437 | Pacific/Niue                               | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      438 | Pacific/Norfolk                            | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      439 | Pacific/Noumea                             | 2011-00-00 00:00:00 | 2011-00-00 00:00:00 |          0 |      0 | 
|      440 | Pacific/Pago Pago                          | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      441 | Pacific/Palau                              | 0009-00-00 00:00:00 | 0009-00-00 00:00:00 |          0 |      0 | 
|      442 | Pacific/Pitcairn                           | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      443 | Pacific/Ponape                             | 2011-00-00 00:00:00 | 2011-00-00 00:00:00 |          0 |      0 | 
|      444 | Pacific/Port Moresby                       | 2010-00-00 00:00:00 | 2010-00-00 00:00:00 |          0 |      0 | 
|      445 | Pacific/Rarotonga                          | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      446 | Pacific/Saipan                             | 2010-00-00 00:00:00 | 2010-00-00 00:00:00 |          0 |      0 | 
|      447 | Pacific/Samoa                              | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      448 | Pacific/Tahiti                             | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
|      449 | Pacific/Tarawa                             | 2012-00-00 00:00:00 | 2012-00-00 00:00:00 |          0 |      0 | 
|      450 | Pacific/Tongatapu                          | 2013-00-00 00:00:00 | 2013-00-00 00:00:00 |          0 |      0 | 
|      451 | Pacific/Truk                               | 2010-00-00 00:00:00 | 2010-00-00 00:00:00 |          0 |      0 | 
|      452 | Pacific/Wake                               | 2012-00-00 00:00:00 | 2012-00-00 00:00:00 |          0 |      0 | 
|      453 | Pacific/Wallis                             | 2012-00-00 00:00:00 | 2012-00-00 00:00:00 |          0 |      0 | 
|      454 | Pacific/Yap                                | 2010-00-00 00:00:00 | 2010-00-00 00:00:00 |          0 |      0 | 
|      486 | Pacific/French Polynesia-Marquesas Islands | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |          0 |      0 | 
+----------+--------------------------------------------+---------------------+---------------------+------------+--------+
41 rows in set (0.00 sec)

This was with the newest Event module on Drupal 6.2

macgirvin’s picture

subscribe

gerhard killesreiter’s picture

Status: Active » Fixed

fixed in cvs

gerhard killesreiter’s picture

note: you'll need to run update.php

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.