生成日志时总要输出时间,这个函数将字符串格式的时间保存在bufTime中.
第一个参数char 数组,第二个参数数组长度
void getNowTime(char* bufTime,int bufTimeLength)
{
time_t now;
struct tm *info;
time(&now);
info = localtime(&now);
info->tm_hour=(info->tm_hour)+8;
strftime(bufTime,bufTimeLength,"%Y-%m-%d %H:%M:%S",info);
return ;
}