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 Quote Link to comment 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(). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.