S
S
Simtel2012-12-02 20:34:59
PHP
Simtel, 2012-12-02 20:34:59

Store and read lap times

Good time of the day.

There is a project dedicated to the game F1. There is a functionality for publishing lap records on the selected track.

The lap time of this format is 1:44.912 Tell me

how to store it correctly in mysql (now varchar) and how to calculate the difference, for example, with the result 1:39.004

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
edogs, 2012-12-02
@Simtel

Store in int
Calculate as 1:44.912=1000*60*1+1000*44+912 and vice versa accordingly.
The difference and the average and so on - is calculated very simply.

M
Michael, 2012-12-02
@1099511627776

dev.mysql.com/doc/refman/5.0/en/fractional-seconds.html and if so?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question