I’m trying to store a 12/24hr (ie; 00:00) clock time in a MySQL database. At the moment I am using the time datatype. This works ok but it insists on adding the seconds to the column. So you enter 09:20 and it is stored as 09:20:00. Is there any way I can limit it in MySQL to just 00:00?
Share
That doesn’t look possible. The
TIMEdata type is defined to represent the time of the day (or elapsed time) with a 1 second resolution. However, you can always use theDATE_FORMAT()function to format your field asHH:MMin aSELECTquery: