From 3751dbe8f4d1472b99d2d211bd0c136972e2ff7b Mon Sep 17 00:00:00 2001 From: Heiko Hund Date: Tue, 6 Nov 2012 15:25:14 +0100 Subject: [PATCH] convert connection time from UTC to local time --- localization.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/localization.c b/localization.c index 17b4d4a..ec66dbe 100644 --- a/localization.c +++ b/localization.c @@ -99,10 +99,12 @@ int LocalizedTime(const time_t t, LPTSTR buf, size_t size) { /* Convert Unix timestamp to Win32 SYSTEMTIME */ + FILETIME lft; SYSTEMTIME st; LONGLONG tmp = Int32x32To64(t, 10000000) + 116444736000000000; FILETIME ft = { .dwLowDateTime = (DWORD) tmp, .dwHighDateTime = tmp >> 32}; - FileTimeToSystemTime(&ft, &st); + FileTimeToLocalFileTime(&ft, &lft); + FileTimeToSystemTime(&lft, &st); int date_size = 0, time_size = 0; LCID locale = MAKELCID(GetGUILanguage(), SORT_DEFAULT);