Bug 104931

Summary: Timezone (Local) doesn't obey DST
Product: [Applications] kst Reporter: Matthew Truch <matt>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: Slackware   
OS: Linux   
Latest Commit: Version Fixed In:

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);
 }