haitao:
到底怎么取当前时间比较好?怎么这么多方法的?
[阅读: 586] 2004-12-17 05:36:25
struct timeb mtp;
ftime(&mtp);
memset(STIME,0,31);
t = localtime(&mtp.time);
sprintf(STIME, "%02d%02d %02d:%02d:%02d.%03d",
t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, mtp.millitm);
我找到一个例子:
struct tm *pt;
long ti;
time(&ti);
pt=localtime(&ti);