coolex Posted September 25, 2006 Share Posted September 25, 2006 Hello!I try to insert times into my database.I created a time field in a table and want to enter AM/PM time into it.For example "insert into test(time) values('10:00:00 PM');"After that I want to view my table: "select time_format(time, '%r') from test;"I get this time (10:00:00) not as PM but always as AM. But I want it as PM in my DB.How can I insert AM/PM time directly?PLease help!ThanksAlex Link to comment https://forums.phpfreaks.com/topic/21935-problems-by-inserting-time-am-and-pm/ Share on other sites More sharing options...
fenway Posted September 25, 2006 Share Posted September 25, 2006 If you want to use a formatted string for _input_, you'll need to use STR_TO_DATE(). Link to comment https://forums.phpfreaks.com/topic/21935-problems-by-inserting-time-am-and-pm/#findComment-98135 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.