您的位置:首页 > 其它

编译时间格式转换dd/mm/yyyy

2012-09-05 21:05 295 查看
void GetBuildTime(CString &str)

{

char Date[]=__DATE__;

char mon_s[20]={0};

static const char month_names[] = "JanFebMarAprMayJunJulAugSepOctNovDec";

int mon=0, day=0, year=0;

sscanf(Date, "%s %d %d", mon_s, &day, &year);

mon = (strstr(month_names, mon_s)-month_names)/3+1;

str.Format("BuildTime:%02d/%02d/%04d %s",mon, day, year, __TIME__);

return;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: