//定义CString数据类型和字符数组
CString Cstr0;
char czS8[32];
//定义时间参数
struct tm *local;
time_t t;
//给字符数组初始化
memset(czS8, 0, sizeof(czS8));
//时间初始化
t = time(NULL);
local = localtime(&t);
//用CString形式保存时间
Cstr0.Format(_T("%02d_%02d_%02d.db"), (local->tm_year + 1900), (local->tm_mon + 1), (local->tm_mday));
//***将CString 转换为 char[]
USES_CONVERSION;
strcpy(czS8, T2A(Cstr0));
//谢谢参~赏~