range
-
-
I want to add items between two dates.I used CTime class to find the two dates(current and past). i want to add the list of url's i opened that range of time.Everything is fine but how can we make the condition on times for ex: for or while or if etc
CTime
has normal add and compare operators, so you can loop on aCTime
the same way you would do with an integer.~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb -
CTime
has normal add and compare operators, so you can loop on aCTime
the same way you would do with an integer.~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverbCTime CurTime = CTime::GetCurrentTime(); CString sTime1,sHour,sTime2; sTime1.Format("%d/%d/%d",CurTime.GetYear(),CurTime.GetMonth(),CurTime.GetDay()); sTime2.Format"%d/%d/%d", .......); m_time1.SetWindowText(sTime1); m_time2.SetWindowText(sTime2); if(sTime1 > sTime2) { //Do something //lets say m_time3.SetWindowText("Real time"); } UpdateData(FALSE); :)
Bravoone
-
CTime CurTime = CTime::GetCurrentTime(); CString sTime1,sHour,sTime2; sTime1.Format("%d/%d/%d",CurTime.GetYear(),CurTime.GetMonth(),CurTime.GetDay()); sTime2.Format"%d/%d/%d", .......); m_time1.SetWindowText(sTime1); m_time2.SetWindowText(sTime2); if(sTime1 > sTime2) { //Do something //lets say m_time3.SetWindowText("Real time"); } UpdateData(FALSE); :)
Bravoone
I have converted file time to system time using the function, FileTimeToSystemTime(&suURL.ftLastVisited,&st); Now can i get the time in CTime from the above line.I am able to display the string value for that particular systemtime.otherwise how can we convert CString to CTime. Thanks
-
I have converted file time to system time using the function, FileTimeToSystemTime(&suURL.ftLastVisited,&st); Now can i get the time in CTime from the above line.I am able to display the string value for that particular systemtime.otherwise how can we convert CString to CTime. Thanks
radhika28 wrote:
otherwise how can we convert CString to CTime.
If the time is in a standard format, use
COleDateTime::ParseDateTime()
. TheCTime
class is too limiting.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb