From 534f88d43e995f48665f3d2a7ae57fbcff5badcf Mon Sep 17 00:00:00 2001 From: blueswir1 Date: Sat, 4 Aug 2007 10:56:25 +0000 Subject: [PATCH] Use UTC/localtime flag in M48Txx --- hw/m48t59.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/m48t59.c b/hw/m48t59.c index cda28c2f65..053acb5c06 100644 --- a/hw/m48t59.c +++ b/hw/m48t59.c @@ -80,7 +80,10 @@ static void get_time (m48t59_t *NVRAM, struct tm *tm) #ifdef _WIN32 memcpy(tm,localtime(&t),sizeof(*tm)); #else - localtime_r (&t, tm) ; + if (rtc_utc) + gmtime_r (&t, tm); + else + localtime_r (&t, tm) ; #endif } @@ -146,7 +149,10 @@ static void get_alarm (m48t59_t *NVRAM, struct tm *tm) #ifdef _WIN32 memcpy(tm,localtime(&NVRAM->alarm),sizeof(*tm)); #else - localtime_r (&NVRAM->alarm, tm); + if (rtc_utc) + gmtime_r (&NVRAM->alarm, tm); + else + localtime_r (&NVRAM->alarm, tm); #endif } -- 2.11.4.GIT