struct cc_timeval now; CCTime::gettimeofdayCocos2d(&now, NULL); struct tm *tm; tm = localtime(&now.tv_sec); int year = tm->tm_year + 1900; int month = tm->tm_mon + 1; int day = tm->tm_mday; int hour=tm->tm_hour; int minute=tm->tm_min; int second=tm->tm_sec; long millSecond=now.tv_sec * 1000 + now.tv_usec / 1000;
struct tm *tm; time_t timep; time(&timep); tm = localtime(&timep); int year = tm->tm_year + 1900; int month = tm->tm_mon + 1; int day = tm->tm_mday; int hour=tm->tm_hour; int minute=tm->tm_min; int second=tm->tm_sec;
联系客服