2008年8月5日

tosec

Convert time format to sec:
int tosec(char *time)
{
int sec=0;
char hh[3];
char mm[3];
char ss[3];

hh[0]=time[0];
hh[1]=time[1];
mm[0]=time[3];
mm[1]=time[4];
ss[0]=time[6];
ss[1]=time[7];
sec=atoi(hh)*3600+atoi(mm)*60+atoi(ss);
return sec;
}

沒有留言: