How to get the exact date and time after updating a record?
Whenever I update the user data, it returns me the wrong time, for example:
I updated the user profile at 16: 41, but in my database it appears like this 2019-10-15 16:10:53
I am using mysql along with phpmyadmin
This Is My array to update the Data
date_default_timezone_set('America/Sao_Paulo');
$data = array(
'updated_at' => date('Y-m-d : H:m:s', time()),
);
0
Author: Mike Otharan, 2019-10-15
2 answers
Try changing the update date by replacing the minutes ('m') with ('i')
date_default_timezone_set('America/Sao_Paulo');
$data = array(
'updated_at' => date('Y-m-d : H:i:s', time()),
);
Send bullet and see what da.
4
Author: Aiden Pearce, 2019-10-15 19:56:28
You are entering the month instead of the minutes. The correct syntax is:
date('Y-m-d H:i:s', time())
1
Author: Gabriel Souto, 2019-10-16 12:52:48