From 24f2532913cee8f48f32ffad569bd343076d9207 Mon Sep 17 00:00:00 2001 From: Jan Bodnar Date: Mon, 1 Feb 2016 10:06:32 +0100 Subject: [PATCH] Create get_time_zone.c --- datetime/get_time_zone.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 datetime/get_time_zone.c diff --git a/datetime/get_time_zone.c b/datetime/get_time_zone.c new file mode 100644 index 0000000..5ad6d04 --- /dev/null +++ b/datetime/get_time_zone.c @@ -0,0 +1,20 @@ +#include +#include + +int wmain(void) { + + TIME_ZONE_INFORMATION tzi = {0}; + + int r = GetTimeZoneInformation(&tzi); + + if (r == TIME_ZONE_ID_INVALID) { + + wprintf(L"Failed to get time zone %d", GetLastError()); + return 1; + } + + wprintf(L"Time zone: %ls\n", tzi.StandardName); + wprintf(L"The bias is: %ld minutes\n", tzi.Bias); + + return 0; +}