Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time Format 00:00:00

Status
Not open for further replies.

New2This

Programmer
Apr 9, 2002
4
CA
Hi
I need to write an application that keeps track of swimmers times. The format that the time needs to be in is
mm:sec:milSec or 00:00:00
I am using SQL server 7 for the database -- I have tried setting the field as date/time but its not giving me the correct format.
Can someone help!!

Thanks
New2This
 
Your best bet is to store the time as a number (decimal) in seconds and then convert and format it for display purposes.

in database and program variables: 75.25
On your form: 1:15.25

If the times are always in seconds you can easily do math on the times to calculate splits, lap times and pb's (personal bests). Then write two functions: the first converts the seconds to the display time (Seconds to mm:sec:milSec) that the user can understand, the second converts a user entered time to seconds (mm:sec:milSec to Seconds) for the database and math calculations. Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top