Author Topic: Time appears 1 hour later than set  (Read 7035 times)

Offline metallicx

  • Newbie
  • *
  • Posts: 2
Time appears 1 hour later than set
« on: February 09, 2007, 11:44:10 PM »
When setting my timezone to Central Standard Time (CST), my inbox messages appear to be 1 hour later.

For instance, if it is 10:42pm CST and a new message arrives, my inbox shows that it arrived at 11:42pm CST instead. This appears to happen with other timezones as well.

Offline dukhunter99

  • Jr. Member
  • **
  • Posts: 27
Re: Time appears 1 hour later than set
« Reply #1 on: February 11, 2007, 06:51:14 PM »
this is because your daylight savings box is checked. just because the box is checked doesn't mean that it automatically adjusts to daylight savings time. You have to manually check and uncheck it depending if you are or not officially in daylight savings time.

P.S. Maybe this is something I should request as a mod. Automatic daylight savings adjustment

Offline Slug

  • Jr. Member
  • **
  • Posts: 76
Re: Time appears 1 hour later than set
« Reply #2 on: February 12, 2007, 12:29:09 AM »
Quote from: dukhunter99
P.S. Maybe this is something I should request as a mod. Automatic daylight savings adjustment

You better believe it, I too thought the check box was to enable AUTOMAGIC daylight savings time adjustment

Michael
Roundcube SVN 1335|PHP 5.2.4|hMailServer 5|Win 2003 SP2|IIS 6

Offline metallicx

  • Newbie
  • *
  • Posts: 2
Re: Time appears 1 hour later than set
« Reply #3 on: February 12, 2007, 12:46:52 AM »
Thank you very much, you were exactly right.

I would have never tried this, because I too thought this meant that it would switch automatically with daylight savings time.

Thanks again!

Offline javiaw

  • Newbie
  • *
  • Posts: 7
Time appears 1 hour later than set
« Reply #4 on: October 31, 2008, 06:32:44 AM »
Last Saturday the time was changed and a user realized that email time appeared wrongly. I've been checking the code and I've found this:

program/include/main.inc,line ~1510 (using rc 0.1.1):

// get user's timezone
  $tz = $CONFIG['timezone'];
  if ($CONFIG['dst_active'])
    $tz++;


I don't known why the if condition should depend on the user's choice, so I find more logical that the if checks in the system whether dst is active or not:

// get user's timezone
  $tz = $CONFIG['timezone'];
  if ((bool)date('I'))
    $tz++;


It changes the hour automatically, and now it works fine. I hope it will still work after 6 months.

Offline tjm74

  • Jr. Member
  • **
  • Posts: 10
Daylight Saving (DST) should just work.
« Reply #5 on: November 17, 2008, 02:35:37 PM »
It is absolutely ridiculous to make everyone revisit their timezone settings every six months each time the clocks change.

Whoever set this up must live in Arizona or some country where they do not change the clocks.

I have changed my label for this checkbox preference, from "Daylight saving time" to "Auto-adjust Daylight Saving" which is what 99% of users expect this checkbox to do.  Then, the implementation of that behavior is a quick patch to one line

in program/include/main.inc line 731 (0.2b)
-    if ($CONFIG['dst_active'])
+    if ($CONFIG['dst_active'] && (bool)date('I'))
      $tz++;

Here is the label change:
./program/localization/en_US/labels.inc
- $labels['dstactive']  = 'Daylight saving time';
+ $labels['dstactive']  = 'Auto-adjust Daylight Saving';

This increments the local timezone offset only if the user has checked the box AND it's actually the right time of year.

Granted, this solution is still not right if your server is not in an area that observes DST (ie and the poor user *is* in a DST-observing location).  Also, the time may be incorrect for a week or two every year if the user and server do not share the same official clock shifting rules/dates.

But this patch will make things "just work right" for 99% of you out there.

Offline tttonyyy

  • Newbie
  • *
  • Posts: 1
Time appears 1 hour later than set
« Reply #6 on: January 28, 2009, 05:43:31 AM »
Thanks for the patch, works a treat.

I also assumed it was "auto" and found this thread via google.  Lets hope it goes in the next release. :)