char *gettime(char *msg)
{
struct timeb tp;
struct tm ltime;
ftime(&tp);
localtime_r(&tp.time,<ime);
sprintf(msg,"%04d-%02d-%02d %02d:%02d:%02d.%03d %d",
ltime.tm_year+1900,
ltime.tm_mon+1,
ltime.tm_mday,
ltime.tm_hour,
ltime.tm_min,
ltime.tm_sec,
tp.millitm,
ltime.tm_wday);
return msg;
}
阅读(1909) | 评论(0) | 转发(0) |