专注于高品质PHP技术等信息服务于一体 [STIEMAP] [RSS]

百度提供的广告:
c#
当前位置:首页 > 技术文档 > c# >  > 
vc++ 获得系统时间格式化输出
#include <iostream>
#include <Windows.h>
#include <time.h>
using namespace std;
void main()
{
    time_t now;
    time(&now);
    char buff[20];
    strftime( buff, sizeof(buff),"%Y/%m/%d %H:%M:%S ",localtime(&now) );
    cout<<buff<<endl;
}
%Y/%m/%d %H:%M:%S 表示 年 月 日 时 分秒