Results 1 to 2 of 2
Thread: Format DateTime
Oct 24, 2011, 01:19 #1
- Join Date
- Oct 2011
- 0 Post(s)
- 0 Thread(s)
I had problem in displaying datetime using select statement.
I have TimeIn and TimeOut with datatype DateTime
I want to display it (dd-mm-yyyy) and the hours is 12 hours with AM and PM.
now it display:
TimeIn: 2011-10-24 05:35:00
TimeOut: 2011-10-24 13:35:00
this is my code:
$sql = "SELECT EMP_NO, TimeIn, TimeOut FROM attendance WHERE Date BETWEEN '$DATE1' AND '$DATE2'";
TimeIn: 24-10-2011 05:35 AM
TimeOut: 24-10-2011 014:35 PM
I tried to find syntax for that but it did not match on what format i want.
Oct 24, 2011, 02:00 #2
You can do it in your query: http://dev.mysql.com/doc/refman/5.5/...on_date-format
or in PHP: http://fr.php.net/manual/en/function.date.php
Take a look at this as well: http://www.sitepoint.com/forums/show...=1#post4977163