Friday 15 March 2013

time - How to convert a struct tm to DateTime in c++/cli -


I have a variable in c ++ / CLI whch which holds time in the form of struct tm; How can I do this? struct tm t = GetTime (); DateTimeTime = ConvertToDateTime (T);

In the above code, how do I implement convert?

There will be a way:

  struct tm t = GetTime () ; // Not sure about the syntax, the constructor is calling C ++, // but I think you get this idea. Date Time Time = Date Time (t.tm_year + 1900, t.tm_mon + 1, t.tm_day, t.tm_hour, t.tm_min, t.tm_sec);    

No comments:

Post a Comment