标准库函数:
struct tm* localtime(const time_t *timer);
struct tm* _localtime64(const __time64_t *timer);
char* asctime(const struct tm *timeptr);
wchar* _wasctime(const struct tm *timeptr);
头文件:<ctime>
把timer时间转换成tm时间。例如:
int _tmain(int argc, _TCHAR* argv[])
{
tm *newTime;
__time64_t t;
_time64(&t);//取得系统时间
newTime = _localtime64(&t);
char *p = asctime(newTime);
return 0;
}