I want to insert a user login log into a database table. In the column where I want to save the current time is "date_time decimal (10,0) NOT NULL DEFAULT" 0 "". When inserting data, I set the field as
$this->mytable->date_time = time();
My request was successful. But when I want to display the input time, it shows a time that does not match the time of my PC (local server). To display the time I'm writing
echo date('Ymd h:i:s A', $log->date_time);
I test several times, but it shows a time that is 4 hours less than the exact time. In my test, the current time is 2013-09-15 04:46:34 PM, but the row table shows 2013-09-15 12:46:34 PM.
Please help me. I can not find out about the error.
Nantu source share