Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Time Conversion
Message
 
À
18/06/1999 17:33:59
Dovi Gilberd
Dovtware Consulting Inc
Miami, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00231633
Message ID:
00231662
Vues:
16
>i have a question for you any body can help me..
>i have two character fields in a column
>
> field 1 field 2
> start time end time
>like such 130100 130700
>
>what i need to do is the following sobstract field 1 from 2 and get elapsed time results in minutes and seconds like such 06:00 meaning 6 minutes and 00 seconds
>please help me achieve this task....i would really appreciate it.......thank you

If you are willing to change your time format to have characters with ":" the subtraction to get seconds becomes

nSecondsElapsed = int(val(ctot(cTime2) - ctot(cTime1)))

Converting this back to a character is

cMinSecElapsed = padl(alltrim(str(int(nSecondsElapsed/60))),2,"0")+":"+padl(alltrim(str(mod(nSecondsElapsed,60))),2,"0")
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform