Time Comparisons
-
How do I compare times using CTime. When I retreive a CTime value from the registry and compare it to the current time (using CTime::GetCurrentTime(), it also compares the dates which are several days apart. I need to compare the time part. Is there a way to mask out the date part then check if the current time is > or < the time saved in the registry?:confused: :confused: Paul Jahans
-
How do I compare times using CTime. When I retreive a CTime value from the registry and compare it to the current time (using CTime::GetCurrentTime(), it also compares the dates which are several days apart. I need to compare the time part. Is there a way to mask out the date part then check if the current time is > or < the time saved in the registry?:confused: :confused: Paul Jahans
you could create two new CTime objects like this:
CTime t1(1900,1,1,inTime1.GetHour(), inTime1.GetMin(), inTime1.GetSecond());
CTime t2(1900,1,1,inTime2.GetHour(), inTime2.GetMin(), inTime2.GetSecond());then compare t1 and t2. (there might be a better way, tho) -c
Garbage collection, making life better - for weenies!
Image Processing - just like mom used to make.
-
How do I compare times using CTime. When I retreive a CTime value from the registry and compare it to the current time (using CTime::GetCurrentTime(), it also compares the dates which are several days apart. I need to compare the time part. Is there a way to mask out the date part then check if the current time is > or < the time saved in the registry?:confused: :confused: Paul Jahans
look at CTimeSpan, it might help you Max
-
you could create two new CTime objects like this:
CTime t1(1900,1,1,inTime1.GetHour(), inTime1.GetMin(), inTime1.GetSecond());
CTime t2(1900,1,1,inTime2.GetHour(), inTime2.GetMin(), inTime2.GetSecond());then compare t1 and t2. (there might be a better way, tho) -c
Garbage collection, making life better - for weenies!
Image Processing - just like mom used to make.