Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How many hours
Message
From
17/12/2003 17:58:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
17/12/2003 16:24:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00860109
Message ID:
00860168
Views:
13
>Hi all
>
>I have a field that store's time like this
>00:00:45 forty five seconds
>00:52:50 fifty two minutes and fifty seconds
>01:20:50 one hour and twenty minutes and fifty seconds
>
>And I want to do a sum on it to see how many hours was spend one something how I do it ?

To get only hours: Add the hours, minutes and seconds separately. Divide minutes by 60, and seconds by 3600, to convert everything to hours.

If you want to get hours, minutes and seconds separately in the sum:

Add hours, minutes and seconds separately. Divide seconds by 60, and pass the integral part to minutes (minutes = minutes + (seconds / 60)). Leave the remainder in seconds (for instance, seconds = seconds % 60).

Proceed similarly to add surplus minutes to the hours.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform