aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index 624da0fd3c..641629b1ce 100644
--- a/vl.c
+++ b/vl.c
@@ -460,8 +460,11 @@ int qemu_timedate_diff(struct tm *tm)
if (rtc_date_offset == -1)
if (rtc_utc)
seconds = mktimegm(tm);
- else
- seconds = mktime(tm);
+ else {
+ struct tm tmp = *tm;
+ tmp.tm_isdst = -1; /* use timezone to figure it out */
+ seconds = mktime(&tmp);
+ }
else
seconds = mktimegm(tm) + rtc_date_offset;