Original Post
Hello All A simple question I believe. I need to calculate time spent on some activity. Let's say the activity started at 2 o'clock PM and finished at 4 o'clock PM. This case is easy: total_time = end_time start_time 4-2=2 That formula doesn't work for an example where the activity started at 10 o'clock AM and finished at 2 PM 2-10=-8 (rubish!) I remember this is some basic exercise we had at the university but I just cannot recall the solution. I'd greatly appreciate any hints. Many thanks