Hi, can anyone help me? When converting an integer to a time duration and the duration is going to be greater than a day the duration doesn't show properly. For example if i have an integer value of 36000000 and convert this to a time it shows correctly as 10:00:00 as in 10 hours. However if my integer value gets to 115200000 the duration shows as 08:00:00 rather than 31:00:00. Is there an elegant way to handle this does anyone know?
0
Comments
Original DateTime : 12/12/09 09:56 AM
Adding Duration : 10 hours
Result DateTime : 12/12/09 07:56 PM
Duration is the difference between two date times, it can be added to times, or FORMAT'ed to see the "10 Hours".
Really, changing vDuration to 115200000 is 1 Day 8 Hours (24+8) 32 hrs. But there is no Time of 32:00:00. If you try to format that into a "Time" the time is 8. The DURATION is 32. Changing vDuration to 115200000 the Result is...
Original DateTime : 12/12/09 09:58 AM
Adding Duration : 1 day 8 hours
Result DateTime : 12/13/09 05:58 PM
You can set a Datetime to whatever you really need, but I don't understand what more you want from Duration. Duration is saying the amount of ms. 36000000 = 1000ms * 60s * 60m * 10Hr
Lavin
"Profanity is the one language all programmers know best."