about summary refs log tree commit diff
path: root/src/time/mktime.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/time/mktime.c')
-rw-r--r--src/time/mktime.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/time/mktime.c b/src/time/mktime.c
index 0ab47802..bad3f076 100644
--- a/src/time/mktime.c
+++ b/src/time/mktime.c
@@ -10,14 +10,14 @@ time_t mktime(struct tm *tm)
 	__secs_to_zone(t, 1, &new.tm_isdst, &new.__tm_gmtoff, &opp, &new.__tm_zone);
 
 	if (tm->tm_isdst>=0 && new.tm_isdst!=tm->tm_isdst)
-		t += opp - new.__tm_gmtoff;
+		t -= opp - new.__tm_gmtoff;
 
-	t += new.__tm_gmtoff;
+	t -= new.__tm_gmtoff;
 	if ((time_t)t != t) goto error;
 
 	__secs_to_zone(t, 0, &new.tm_isdst, &new.__tm_gmtoff, &opp, &new.__tm_zone);
 
-	if (__secs_to_tm(t - new.__tm_gmtoff, &new) < 0) goto error;
+	if (__secs_to_tm(t + new.__tm_gmtoff, &new) < 0) goto error;
 
 	*tm = new;
 	return t;