Page 1 of 1

Newbie needs date/time help please

Posted: Thu Jan 09, 2003 11:13 pm
by roguephp
Hi all,

Newish to mySQL and php - I am developing a small table of class schedules. I am not sure what the best way to store (and what format) the start and end time for each class. I want to display something like this:

12:00pm - 1:30pm

Any assistance would be great. Thanks.

- Charles

Posted: Fri Jan 10, 2003 2:35 am
by twigletmac
If you store the times in a TIME or TIMESTAMP type column in MySQL then you can easily use one of MySQLs Date & Time Functions such as DATE_FORMAT() to convert the time to how you'd like to display it. Doing it this way means that if you change the way you'd like to display the data you don't have to change the data only the SQL statement drawing the info out.

Mac