Hello forums
I am trying to log to a mysql dbase the exact time a user logs in including seconds with this:
$time_in = gmdate('Y-m-d H:i:s');
$ad = mysql_query("INSERT INTO sd_record (id, time_in) VALUES ('$id', '$time_in') ;
Which will insert something like this in the database:
2010-05-05 15:59:15
(my database table is set to datetime with a default value of 0000-00-00 00:00:00)
Question :
When I retrieve this back how can I format it with GMT+8
the code below doesn’t work:
//database query select time_in from blah blah
$time_in = gmdate('M d, Y l | h:i:s', strtotime($r['time_in']));
echo $time_in
the above code is giving me
May 05, 2010 Wednesday | 03:59:15
how do I correct this to give me the right time w/c is
May 05, 2010 Wednesday | 12:59:15
Tnx in advance