【问题标题】:cocos2D-X c++ convert string to Datecocos2D-X c++ 将字符串转换为日期
【发布时间】:2014-01-29 14:32:40
【问题描述】:

我正在寻找一种可以将字符串转换为日期时间对象的方法。我看到 cocos2d-X dosent 包含一个 NSDate 类。谁能帮帮我?

亲切的问候

【问题讨论】:

标签: c++ cocos2d-x


【解决方案1】:
    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;
            }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-27
    • 2011-11-28
    相关资源
    最近更新 更多