Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How many hours
Message
De
17/12/2003 17:58:43
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
17/12/2003 16:24:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00860109
Message ID:
00860168
Vues:
12
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform