C++获取时间并命名为文件名
#include <time.h>
char pStrPath1[20];
time_t currTime;
struct tm *mt;
Mat saveImg1;
currTime = time(NULL);
mt = localtime(&currTime);
/*根据日期生成文件名*/
sprintf(pStrPath1, "D:\\images\\face\\yr0905\\%d%02d%02d%02d%02d%02d.jpg", mt->tm_year + 1900, mt->tm_mon + 1, mt->tm_mday, mt->tm_hour, mt->tm_min, mt->tm_sec);
imwrite(pStrPath1, saveImg1);
QQ 3087438119