I am programming MFC with Visual Studio 2010 in Central Europe.
I have 2 time picker that i use to get the duration of two different jobs
and I get on my code the time setted in these control using a CTime variable.
I also have an edit control that have to display the sum of the 2 pickers previously setted.
My code is the following:
CTimeSpan CTSTotalJobsTime, CTSJob1, CTSJob2;
CTSJob1 = TimeJob1 - CTime(0);
CTSJob2 = TimeJob2 - CTime(0);
CTSTotalJobsTime = CTSJob1 + CTSJob2;
CString strTotalJobsTime = CTSTotalJobsTime.Format(_T("%H:%M:%S"));
THIS IS MY SOLUTION:
I tried to use CTimeSpan and the date time picker control, but i see that they don't work for me because CTimeSpan parameter are day, hours, minutes, second while i use the date time picker only for time (no days).
So when i set the hours at 00, thanks to UTF automatic conversion, my CTimeSpan change day to the previose one and set the hours to 23.
So, i decided to delete the date time picker and use 3 differnt CEdit for hours, minutes, second.