19,504
社区成员
发帖
与我相关
我的任务
分享
unsigned long strtotime(char *date)
{
struct tm t;
unsigned long time;
sscanf(date,"%d-%d-%d",&t.tm_year,&t.tm_mon,&t.tm_mday);
t.tm_year-=1900;
t.tm_mon-=1;
t.tm_hour=0;
t.tm_min=0;
t.tm_sec=0;
time=mktime(&t); //转换
return time;
}