struct tm *when;
time_t loc_time;
char s[80],stime[80],daytime[80];
loc_time = time(NULL);
when = localtime(&loc_time);
strftime(stime,100,"%c",when);
本来是2009-09-09 20:13:09的,本机时间来没有错,但是输出2011-09-09 20:13:09,总跑到2011年去,搞不懂为什么