獲取的時(shí)間不對(duì)
struct timeval nowTimeval;
gettimeofday(&nowTimeval,NULL);
struct tm *tm;
time_t time_sec;
time_sec = nowTimeval.tv_sec;
tm = localtime(&time_sec);
CCLOG("hour = %d ,minitue = %d, second = %d",tm->tm_hour,tm->tm_min,tm->tm_sec);
struct timeval nowTimeval;
gettimeofday(&nowTimeval,NULL);
struct tm *tm;
time_t time_sec;
time_sec = nowTimeval.tv_sec;
tm = localtime(&time_sec);
CCLOG("hour = %d ,minitue = %d, second = %d",tm->tm_hour,tm->tm_min,tm->tm_sec);
舉報(bào)
2016-06-01