How can I compliet to zero if I have 14:3 --> 14:03
from these I get sNewMinute = "";
//sNewMinute.Format(minute, "%M"); //sNewMinute.Format(minute, "00");
Visual C++ General
How can I compliet to zero if I have 14:3 --> 14:03
from these I get sNewMinute = "";
//sNewMinute.Format(minute, "%M"); //sNewMinute.Format(minute, "00");
CString str;
str.Format(_T("%02d"), 3);
// str is now "03".
1) Maybe you could tell me how can I add 1 day to CTime
deu_date befor = 115362002
after I add 1 = 115362003
I neet to set 1 to 215362002
//CTime deu_date;
deu_date += 1;
int hour, minute;
_stscanf_s(task_time, _T("%d:%d"), &hour, &minute);
CTimeSpan timeSpan(0, 0, hour, minute, 0);
timeSpan += CTimeSpan(0, 0, 5, 0);
this->task_time = timeSpan.Format(_T("%H:%M"));
mmm..
It's work in this code:
int
pos = this->task_time.Find( ':' );CString sTimeH =
this->task_time.Left(pos);CString sTimeM =
this->task_time.Right(pos); // convert minutes & hours to long long minute = atol(sTimeM); long hour = atol(sTimeH);// ...my add code...
CTimeSpan timeSpan(0, hour, minute, 0);
this->task_time = timeSpan.Format(_T("%H:%M"));
You could tell me how can I add 1 day to CTime
deu_date befor = 115362002
after I add 1 = 115362003
I neet to set 1 to 215362002
//CTime deu_date;
deu_date += 1;