I would like to format a time field that is stored in MySQL table to display such as 2:35 pm instead of 14:35:00
I cannot get any of the datetime examples to work.
3 Answers
Hello, you should be able to use the mysql command to format it the way you want.
What type is the mysql field? Datetime? if yes you should be able to use somethins like this:
SELECT *, DATE_FORMAT(urdatefield, "%d/%m/%Y %r") FROM yourtable;
It is a time field. Not datetime. But when editing the time I want the user to be able to enter it as am or pm.
Your Answer