这种东西一直没用过,前天用了下
#include "stdafx.h"
#include <time.h>
int _tmain(int argc, _TCHAR* argv[])
{
struct tm* pTmNew;
time_t aclock;
::time(&aclock);
pTmNew = ::localtime(&aclock);
printf("Current data and time: %d year %d month %d day %d:%d:%d\n"
, pTmNew->tm_year + 1900
, pTmNew->tm_mon + 1
, pTmNew->tm_mday
, pTmNew->tm_hour
, pTmNew->tm_min
, pTmNew->tm_sec);
return 0;
}
Output:
Current data and time: 2007 year 8 month 26 day 23:0:30
posted on 2007-08-26 23:04
七星重剑 阅读(267)
评论(0) 编辑 收藏 引用 所属分类:
PL--c/c++