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
Newbie needs date/time help please
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
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
Mac