If you're using Microsoft SQL Server or MySQL (I'm confident others will support this too, but those are the only 2 I know for definite) they both contain a dedicated data type for storing time values.
I'd always recommend storing things like dates and times in their dedicated formats (DATE
, TIME
, DATETIME
etc) because then if you need to query the values or otherwise manipulate them, it makes writing SQL easier because the SQL engine is aware of what kind of data is in the field. If you stored dates or times in a VARCHAR
for instance, you may or may not (database engine dependant) be able to write a query which specified SomeDateTimeField >= '2011-01-01 09:00:00' AND SomeDateTimeField <= '2011-01-01 17:00:00'
without it puking, for example.
For reference, the SQL Server and MySQL TIME
data type information is here.