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;