mirror of https://github.com/OpenVPN/openvpn-gui
convert connection time from UTC to local time
parent
2e53dbd254
commit
3751dbe8f4
|
@ -99,10 +99,12 @@ int
|
||||||
LocalizedTime(const time_t t, LPTSTR buf, size_t size)
|
LocalizedTime(const time_t t, LPTSTR buf, size_t size)
|
||||||
{
|
{
|
||||||
/* Convert Unix timestamp to Win32 SYSTEMTIME */
|
/* Convert Unix timestamp to Win32 SYSTEMTIME */
|
||||||
|
FILETIME lft;
|
||||||
SYSTEMTIME st;
|
SYSTEMTIME st;
|
||||||
LONGLONG tmp = Int32x32To64(t, 10000000) + 116444736000000000;
|
LONGLONG tmp = Int32x32To64(t, 10000000) + 116444736000000000;
|
||||||
FILETIME ft = { .dwLowDateTime = (DWORD) tmp, .dwHighDateTime = tmp >> 32};
|
FILETIME ft = { .dwLowDateTime = (DWORD) tmp, .dwHighDateTime = tmp >> 32};
|
||||||
FileTimeToSystemTime(&ft, &st);
|
FileTimeToLocalFileTime(&ft, &lft);
|
||||||
|
FileTimeToSystemTime(&lft, &st);
|
||||||
|
|
||||||
int date_size = 0, time_size = 0;
|
int date_size = 0, time_size = 0;
|
||||||
LCID locale = MAKELCID(GetGUILanguage(), SORT_DEFAULT);
|
LCID locale = MAKELCID(GetGUILanguage(), SORT_DEFAULT);
|
||||||
|
|
Loading…
Reference in New Issue