Bug 104931 - Timezone (Local) doesn't obey DST
Summary: Timezone (Local) doesn't obey DST
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Slackware Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-01 22:40 UTC by Matthew Truch
Modified: 2005-05-06 14:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Truch 2005-05-01 22:40:51 UTC
Version:           1.1.0_beta1 (using KDE KDE 3.4.0)
Installed from:    Slackware Packages
OS:                Linux

When using X (or Y) axis interpret as a time, and the timezone is set to local, kst does not account for daylight savings time.  If the local timezone is used, it should account for daylight savings time (if the timezone has DST, and if it is that time of year).
Comment 1 George Staikos 2005-05-05 04:26:25 UTC
The timezone code in Kst2dplot compares localtime() to gmtime().  gmtime() gives UTC, localtime gives a time relative to the specified timezone.  I guess gmtime() is computing with daylight savings and the hour is canceling out?  I'm not sure yet...  One thing I do know is that this code is also not threadsafe and needs to be fixed before 1.1.0 is released.
Comment 2 George Staikos 2005-05-06 14:53:09 UTC
SVN commit 410016 by staikos:

merged portion of patch from Andrew to fix DST bug (untested by me)
BUG: 104931


 M  +1 -0      trunk/extragear/graphics/kst/kst/kst2dplot.cpp  


--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #410015:410016
@@ -6757,6 +6757,7 @@
   if (!gmtRc || !ltRc) {
     return 0.0;
   }
+  ltRc->tm_isdst = 0;
   return difftime(mktime(gmtRc), mktime(ltRc)) / (-60.0 * 60.0);
 }