cocos2d-x 获取日期
发布时间:2020-12-14 19:48:05 所属栏目:百科 来源:网络整理
导读:struct timeval now;struct tm* time;gettimeofday(now,NULL);time = localtime(now.tv_sec);char date[32] = {0};sprintf(date,"%d%02d%02d",(int)time-tm_year + 1900,(int)time-tm_mon + 1,(int)time-tm_mday);CCLog("%s",date); 系统毫秒数: span style
struct timeval now; struct tm* time; gettimeofday(&now,NULL); time = localtime(&now.tv_sec); char date[32] = {0}; sprintf(date,"%d%02d%02d",(int)time->tm_year + 1900,(int)time->tm_mon + 1,(int)time->tm_mday); CCLog("%s",date); 系统毫秒数: <span style="font-family: Arial,Helvetica,sans-serif;"><span style="white-space:pre"> </span> struct cc_timeval tv;</span> <pre name="code" class="cpp"> CCTime::gettimeofdayCocos2d(&tv,NULL); cout<<tv.tv_sec * 1000 + tv.tv_usec / 1000 <<endl; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |