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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time Only db field 1

Status
Not open for further replies.

jgurgen

Programmer
Mar 9, 2006
192
US
im trying to create a database for my hockey league and i need to keep track of penalties. To do this i need a timeIn and timeOut but i wanna be able to track exact minutes in penatly box. I figure if i can just store time in a db field that would allow me to subtract the two to get the # of minutes and seconds one was in the penalty box.

How can i store just minutes and seconds in the database?

example:
timeIn - 5:35
timeOut - 4:15
Total Time - 1:20
 
hmmm... the TIME datatype, perhaps? :)

the difference can then be obtained using the TIMEDIFF function

r937.com | rudy.ca
 
oh sorry not too familiar with mysql and didnt know there was a time datatype, thought there was only DateTime
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top