I focusing on a equine racing application and also have the have to store passed occasions from races inside a table. I'll be posting data from the comma delimited file that delivers the ultimate amount of time in one format and also the interior passed occasions in another. This is a good example:

Final Time: 109.39  (1 minute, 9 seconds and 39/100th seconds)

Quarter Time: 2260  (21 seconds and 60/100th seconds)

Half Time: 4524     (45 seconds and 24/100th seconds)

Three Quarters: 5993   (59 seconds and 93/100th seconds) 

I'll wish to have the versatility to simply do such things as ft per seconds information and also to convert passed occasions to splits. I'll should also have the ability to easily display the occasions (passed or splits) in fifth of seconds or perhaps in hundredths.

Times in fifths: :223  :451  :564      1:091 (note the last digits are superscripts)

Times in hundredths: 22.60  :45.24  :56.93   1:09.39

Thanks ahead of time for the input.

Generally timespans are generally saved as (1) seconds passed or (2) start / finish datetime. Seconds passed is definitely an integer or perhaps a float / double should you want it. You may be creative / crazy and store all occasions as milliseconds by which situation you'd just have an integer.

If you work with PostgreSQL, you should use interval datatype. Otherwise, any integer (int4, int8) or number your database supports is alright. Obviously, store values on one unit of measure: seconds, minutes, milliseconds.

Everything is dependent how you want to utilize it, but quantity of passed seconds (possibly like a float if required) is unquestionably a popular.

I believe the 109.39 representing 1 min 9.39 sec is fairly silly. Unambiguous, sure, historic tradition maybe, but it is miserable to complete computations with this format. (Not possible, but fixing it throughout import sounds easy.)

I'd store amount of time in a decimal format of some kind -- either an integer representing hundredths-of-a-second, as all of your in other cases are displayed, or perhaps a data-base specific decimal-aware format.

Standard floating point representations might eventually make you question why a equine that went two laps in 20.1 seconds each required 40.200035 seconds to operate both laps combined.