#include <iostream>
#include <time.h>
using namespace std;
int main()
{
time_t ltime;
char tmpbuf[128];
//方法1:分别获取当前时间,日期
/* Display operating system-style date and time. */
_strtime( tmpbuf );
printf( "OS time://t//t//t//t%s//n", tmpbuf ); //打印当前时间
_strdate( tmpbuf );
printf( "OS date://t//t//t//t%s//n", tmpbuf ); //打印当前日期
//方法二:获取当前时间日期
time(<ime); //获取从1970至今经过的秒数
cout << ctime(<ime) << endl; //折算成当前时间日期
return 0;
}