我正在参加一个赛马应用程序,并且需要存储从表中比赛中消耗的时间。我会从一个逗号分隔的文件,提供最后一次在一个格式导入数据和内部的另一个经过时间。下面是一个例子:在数据库中存储已用时间的最佳方式是什么
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)
我会希望有灵活性,容易做的事情一样英尺每秒计算和运行时间转换为分裂。我还希望能够在五秒内或百分之一秒内轻松显示时间(已过或分开)。
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
在此先感谢您的意见。
我正在使用rails。所以也许我可以毫秒储存,然后创建一个辅助方法。 – Mutuelinvestor 2011-06-04 01:03:51