time_t tt; time(&tt); struct tm * now; //获得本地时间 now = localtime(&tt); log("%d/%d/%d %d:%d:%d", now->tm_year + 1900, now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec);
获取时间
原文:http://my.oschina.net/u/1391394/blog/407420