Take the 2-minute tour ×

I am looking for a method in which i can convert a String to datetime object. I see cocos2d-X dosent contain a NSDate class. Can anyone please help me ?

Kind Regards

share|improve this question
Check out this answer: stackoverflow.com/questions/308390/… –  h3nr1x Jan 29 at 14:49
add comment

1 Answer

    You can try CCTime. There  is a function in CCTime gettimeofdayCocos2d()

struct cc_timeval begin;

            virtual float GetElapsedTime(){
                    struct cc_timeval now;
                    return CCTime::timersubCocos2d(&begin,&now)/1000;
share|improve this answer
add comment

Your Answer


