Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to subtract hours, minutes, seconds from same?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Best way to subtract hours, minutes, seconds from same?
Divers
Thread ID:
00394549
Message ID:
00394549
Vues:
57
I subtract the following 2 times to get a time interval which works except when midnight rolls around and my Timea becomes less than my Timeb so Timec ends up negative.

timea - timeb = timec

Timea Char 8 For example hh:mm:ss
Timeb Char 8 For example hh:mm:ss
Timec Char 8 For example hh:mm:ss

For example:
14:30:00 - 13:15:00 = 01:15:00 or 1 hour and 15 minutes

But what if Timea is after midnight?
01:30:00 - 23:15:00 = 01:45:00 or 1 hour and 45 minutes

Is there a nice and easy calculation for this? I convert the Chars to Values and multiply by each to get everything into seconds and then do my subtractions, but midnight messes up my calculations. Any ideas would be appreciated. Thanks for the help.
Steve Kramer
Kramer & Kramer Design
"Home of Go Cartoons"
Web Site: www.stephenkramer.com
Would you believe Far Side Lite?
More than 270 original cartoons.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform