ram
ram

Reputation: 1

How to insert Time with AM/PM to MySQL database using PHP

I want to insert Time in MySQL database. In database I have two separate Fields for Date(date type) and Time(Time type). To insert a record I tried like below in my PHP. But Time only inserted(10:00:00). not AM/PM inserted. How to insert Time with AM/PM in PHP.

mysql_query("INSERT INTO Http(mobile, imei, time,date) VALUES ('1232456785', '123369584895544', TIME_FORMAT( '10:00:00', '%h:%i:%s %p' ),'2011/09/13')");

Upvotes: 0

Views: 6910

Answers (1)

Nick Pavluk
Nick Pavluk

Reputation: 379

You can't do it. Here are formats for TIME type: http://dev.mysql.com/doc/refman/5.0/en/time.html

Upvotes: 3

Related Questions