mysql中写入linux的时间
sprintf(sql,"insert into test(time,dateline) values(FROM_unixtime(%d),addtime(FROM_UNIXTIME(%d),\'%s\'));",time(NULL),time(NULL),"08:10:22") ;
取出mysql中的时间值
sprintf(sql,"select time from test ") ;
MYSQL_RES* result = selectDB(&mysql,sql) ;
MYSQL_ROW row = mysql_fetch_row(result) ;
struct tm local ;
char szBuffer[64] = {0};
const char* pFormat = "%Y-%m-%d %H:%M:%S";
strptime(row[0],pFormat,&local) ;