Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time field without seconds

Status
Not open for further replies.

piranha999

Technical User
Oct 8, 2001
8
AT
Hello

Think this is a newbie question:

How can i change time field inside mysql to not append seconds to the time input. So i want time as format HH:MM and not HH:MM:SS stored. Or isnt this possible?

The alot for you help
 
a datetime or timestamp field will store a seconds value whether you want it to or not

the most you can do is force the seconds to be zero

however, an easier approach is simply to store whatever datetime or timestamp value you wish, then just don't show the seconds whenever you display the values

see the DATE_FORMAT and TIME_FORMAT functions

rudy
SQL Consulting
 
Looks like not available. I know INFORMIX allows this, and also lets you define variable types like a typedef in "C". Only thing close is that datetime type lets you define from left as datetime[4] would be the year only.
 
Alright, thats what i wanted to know.

Thanks alot for the quick answers.



 
cdlvj, you do realize this is the mysql forum?

did you look up the DATE_FORMAT and TIME_FORMAT in the mysql manual?

i assure you they are there

rudy
SQL Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top