time time using MySql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jgarcia
Forum Newbie
Posts: 3
Joined: Wed Apr 09, 2003 12:01 pm
Location: São Paulo - Brasil

time time using MySql

Post 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
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

time functions

Post 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
Post Reply