I am trying to get the time length between two date/time. Ie. 200806131300 and 200806162359, the result is 3 days 10 hours and 59 min. I tried to do it via the MATH action in Xlate but it did not work.
Here is the code snippet from ( trxid_SIU_rxtfc.tcl ) that illustrates how I call the proc ( oth_chk_time_span.tcl ) that does the acutal work of figuring out the time difference:
set timediff [expr [clock scan “20080616T235900”]-[clock scan “20080613T130000”]]
set days [expr $timediff/86400]
set hours [expr $timediff%86400/3600]
set minutes [expr $timediff%86400%3600/60]
echo “$days days $hours hours $minutes min.”
Notice the ‘T’ between the date and the time…. I am sure you can do an insert of some sort…. Also the time must have hhmmss in it for clock scan to work….The results:
3 days 10 hours 59 min.
This was quick and dirty so I hope I didn’t miss anything… Happy Motoring….