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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.