summaryrefslogtreecommitdiffstats
path: root/dst-offset.patch
blob: c1f1cda6e6447f7746a6ce0503efc6d878f4788a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
diff -up gnome-panel-2.21.91/applets/clock/clock-location.c.dst-offset gnome-panel-2.21.91/applets/clock/clock-location.c
--- gnome-panel-2.21.91/applets/clock/clock-location.c.dst-offset	2008-02-19 22:18:55.000000000 -0500
+++ gnome-panel-2.21.91/applets/clock/clock-location.c	2008-02-19 22:19:03.000000000 -0500
@@ -645,17 +645,30 @@ glong
 clock_location_get_offset (ClockLocation *loc)
 {
         ClockLocationPrivate *priv = PRIVATE (loc);
-        glong sys_timezone;
+        glong sys_timezone, local_timezone;
 	glong offset;
+	time_t t;
+	struct tm *tm;
 
+	t = time (NULL);
+	
         unsetenv ("TZ");
-        tzset ();
+        tm = localtime (&t);
         sys_timezone = timezone;
 
+	if (tm->tm_isdst > 0) {
+		sys_timezone -= 3600;
+	}
+
         setenv ("TZ", priv->timezone, 1);
-        tzset();
+        tm = localtime (&t);
+	local_timezone = timezone;
+
+	if (tm->tm_isdst > 0) {
+		local_timezone -= 3600;
+	}
 
-        offset = timezone - sys_timezone;
+        offset = local_timezone - sys_timezone;
 
         if (priv->sys_timezone) {
                 setenv ("TZ", priv->sys_timezone, 1);