cocos2dx3.0如何获取系统时间?。

cocos2dx3.0如何获取系统时间?cc_timeval用不上了。
求解!

google: c time

struct cc_timeval now;
CCTime::gettimeofdayCocos2d (&now, NULL);
timep = now. tv_sec;
struct * tm = localtime(& timep);

都不看就乱回答,3.2上面的获取时间方法用不了了,用系统的
struct timeval nowTimeval;
gettimeofday(&nowTimeval, NULL);
struct tm * tm;
time_t time_sec ;
time_sec = nowTimeval.tv_sec;
tm = localtime(&time_sec);
nMinute = tm->tm_min;
nSecond = tm->tm_sec;
nHour = tm->tm_hour;

正解,谢谢这位仁兄

请问gettimeofday未定义是需要怎么实现?百度了下发现vs打不开sys/time.h

收益了。。

USING_NS_CC

和我电脑的时间有误差

我也是呀。。你解决没?