zq29 Posted January 24, 2006 Share Posted January 24, 2006 As default, the MySQL time datatype is formatted like this: HH:MM:SS, I'm trying to default it to just HH:MM - I have tried setting the fields character length to 5, and I have tried setting the default attribute to 00:00. Neither of these two attempts appear to have worked. Is this possible, or am I looking at altering the times with PHP after I have pulled it from the database? Quote Link to comment Share on other sites More sharing options...
fenway Posted January 24, 2006 Share Posted January 24, 2006 Use MySQL's TIME_FORMAT function -- TIME_FORMAT(yourField, '%H:%i'). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.