This topic is locked

Time storage problem

1/29/2009 9:47:05 PM
PHPRunner General questions
N
netpro author

in example, I may enter 14:34 it is stored in the mysql table as 2000-01-01 14:34:00. How do I either store only the time or the time I enter and today's date? Am I using the wrong field type in the table?

J
Jane 1/30/2009

Hi,
set up this field as Time or Varchar in the database.

S
swanside 1/30/2009

In Visual Editor, You can set up a filed as Date and enter > now()



Then you can also setup another filed as Time and enter > date('H:i:s');



This will then enter the current date in the date field and the current time in the time field.
In the database, I would set the date field up as Datetime, and the time as varchar 10.
Thats what I have set up and it works pretty well.