mirror of
https://github.com/janbodnar/Windows-API-examples.git
synced 2026-07-14 10:12:48 -04:00
Create get_time_zone.c
This commit is contained in:
parent
b300012990
commit
24f2532913
20
datetime/get_time_zone.c
Normal file
20
datetime/get_time_zone.c
Normal file
@ -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;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user