diff options
-rw-r--r-- | vl.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; |