0

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

AndroidDev
  • 15,993
  • 29
  • 85
  • 119
  • Check out this answer: http://stackoverflow.com/questions/308390/convert-a-string-to-a-date-in-c – higuaro Jan 29 '14 at 14:49

1 Answers1

0
    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;
            }
Sumit Kandoi
  • 427
  • 4
  • 12