How do I find system date/time? I'm using visual c++ 6.0 and I haven't come across any function except for time.h(which I can't figure out).
Printable View
How do I find system date/time? I'm using visual c++ 6.0 and I haven't come across any function except for time.h(which I can't figure out).
Code:#include <windows.h>
#include <iostream>
int main(void)
{
SYSTEMTIME st;
GetSystemTime(&st);
const char* DayArray[] = {"Sunday","Monday","Tuesday","Wednesday",
"Thursday","Friday","Saturday"};
std::cout << "It is " << st.wHour << ":";
std::cout << st.wMinute << ":" << st.wSecond;
std::cout << " and the date is " << DayArray[st.wDayOfWeek];
std::cout << " " << st.wDay << "/" << st.wMonth << "/";
std::cout << st.wYear << std::endl;
return 0;
}