sparafucile17
Programmer
Ok here's the problem.....
I have a string(in char* format) representation of time that looks like this: "%Y%m%d%H:%M:%S". An example on the time right now would look like: "2003021611:50:32". But the problem is that I need it in a CTime format. I'll be using the operators '<' and '>' later on to grab the struct with the latest date and time.
So how can I do this? Besides the obvious, which is to parse the full string into little strings that contain year, month, etc and the atoi() them to ints, finally calling the CTime constructor with the all the ints. (I am currently doing this now, but I'm looking for the optimum way to do it.)
I know that CTime will take a time_time object, but I'm not familiar with it. Perhaps the string can be assigned to a time_t object and then a CTime?
Thanks in advance,
Jeff
I have a string(in char* format) representation of time that looks like this: "%Y%m%d%H:%M:%S". An example on the time right now would look like: "2003021611:50:32". But the problem is that I need it in a CTime format. I'll be using the operators '<' and '>' later on to grab the struct with the latest date and time.
So how can I do this? Besides the obvious, which is to parse the full string into little strings that contain year, month, etc and the atoi() them to ints, finally calling the CTime constructor with the all the ints. (I am currently doing this now, but I'm looking for the optimum way to do it.)
I know that CTime will take a time_time object, but I'm not familiar with it. Perhaps the string can be assigned to a time_t object and then a CTime?
Thanks in advance,
Jeff