Datetime difference [More points]
Posted on 2005-04-14
I have 2 datetime variable . I need to find if the difference between these 2 datetime is greater than 30 seconds . Or in simple , I need to find the difference between 2 times in seconds. It need not to be dattime variable.
It has to takecare even if the first datime and second dattime or of different days .
t2: 2/1/1900 00:00:10
t1: 1/1/1900 24:59:50
difference 20 seconds
I tried my best like subtracting t2-t1 , multiplying with 10^6 , but it fails when the days changes.
i need to know some function equivalent to DateDiff or MFC TimeSpan
Quite urgent pls . I will give more points for the quickest.