【发布时间】:2014-01-29 14:32:40
【问题描述】:
我正在寻找一种可以将字符串转换为日期时间对象的方法。我看到 cocos2d-X dosent 包含一个 NSDate 类。谁能帮帮我?
亲切的问候
【问题讨论】:
我正在寻找一种可以将字符串转换为日期时间对象的方法。我看到 cocos2d-X dosent 包含一个 NSDate 类。谁能帮帮我?
亲切的问候
【问题讨论】:
You can try CCTime. There is a function in CCTime gettimeofdayCocos2d()
struct cc_timeval begin;
virtual float GetElapsedTime(){
struct cc_timeval now;
CCTime::gettimeofdayCocos2d(&now,NULL);
return CCTime::timersubCocos2d(&begin,&now)/1000;
}
【讨论】: