This fragment of a console application is made in VS 2005:
#include "stdafx.h"
#include <time.h>
int _tmain(int argc, _TCHAR* argv[])
{
time_t t = time(NULL);
tm s;
gmtime_s(&s, &t);
printf("UTC Time: %02i:%02i:%02i\n",
s.tm_hour, s.tm_min, s.tm_sec);
localtime_s(&s, &t);
printf("Local Time: %02i:%02i:%02i\n",
s.tm_hour, s.tm_min, s.tm_sec);
return 0;
}
It is working with no problem.
In case of MFC applications, you can use CTime class.
In case of Windows API, you can use GetSystemTime function.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
What kind of linker error do you receive
|