21.3. Time

The 32-bit API contains a number of functions for getting and setting times on a Windows system. Listing 21.8 demonstrates all of the different time-retrieval functions.

Code Listing 21.8. The time-retrieval functions
 // timeshow.cpp #include <windows.h> #include <iostream.h> VOID DumpTimeStruct(LPSYSTEMTIME st) { cout << "Year : " << st->wYear << endl; cout << "Month : " << st->wMonth << endl; cout << "Day of Week : " < st->wDayOfWeek << endl; cout << "Day : " << st->wDay << endl; cout << "Hour : " << st->wHour < endl; cout << "Minute : " << st->wMinute << endl; cout << "Second : " << st->wSecond << endl; cout << "Milliseconds: " << st->wMilliseconds << endl; } VOID main(VOID) { SYSTEMTIME st; HANDLE file; FILETIME ft; DWORD ret; ...

Get Win32 System Services: The Heart of Windows® 98 and Windows® 2000 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.