mirror of
https://github.com/janbodnar/Windows-API-examples.git
synced 2024-11-24 11:25:30 +00:00
31 lines
629 B
C
31 lines
629 B
C
#include <windows.h>
|
|
#include <wchar.h>
|
|
|
|
#define NSECS 60*60*3
|
|
|
|
int wmain(void) {
|
|
|
|
SYSTEMTIME st = {0};
|
|
FILETIME ft = {0};
|
|
|
|
GetLocalTime(&st);
|
|
|
|
wprintf(L"%02d/%02d/%04d %02d:%02d:%02d\n",
|
|
st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond);
|
|
|
|
SystemTimeToFileTime(&st, &ft);
|
|
|
|
ULARGE_INTEGER u = {0};
|
|
|
|
memcpy(&u, &ft, sizeof(u));
|
|
u.QuadPart += NSECS * 10000000LLU;
|
|
memcpy(&ft, &u, sizeof(ft));
|
|
|
|
FileTimeToSystemTime(&ft, &st);
|
|
|
|
wprintf(L"%02d/%02d/%04d %02d:%02d:%02d\n",
|
|
st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond);
|
|
|
|
return 0;
|
|
}
|