Page 1 of 1

time time using MySql

Posted: Wed Apr 09, 2003 12:01 pm
by jgarcia
I'm new in PHP and MySql. I'm looking for the time type syntaxe but I haven't found.

The Time type by default stores in the following format : HH:MM:SS, but I need to store just HH:MM. How can I define this .

:?:

TIA

Joao Carlos

time functions

Posted: Wed Apr 09, 2003 12:17 pm
by phpScott
http://www.mysql.com/doc/en/Date_and_ti ... tions.html

ie
SELECT DATE_FORMAT(timeField, "%H%i") FROM someTable WHERE someColumn=someValue

should return hours and minutes.
You can do the same syntax for and insert or update.

phpScott