Skip to content

Commit

Permalink
Create get_time_zone.c
Browse files Browse the repository at this point in the history
  • Loading branch information
janbodnar committed Feb 1, 2016
1 parent b300012 commit 24f2532
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions datetime/get_time_zone.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <windows.h>
#include <wchar.h>

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;
}

0 comments on commit 24f2532

Please sign in to comment.