Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Time Conversion
Message
 
 
To
18/06/1999 17:33:59
Dovi Gilberd
Dovtware Consulting Inc
Miami, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00231633
Message ID:
00231662
Views:
15
>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")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform