2
I am trying to capture the date and time to check the time the user spent without doing any action on the system, but I am having problems with the PHP date function. The code is as follows::
$agora = date("Y-n-j H:i:s");
However, he is returning the day of the month and time incorrectly. Right now it is 19:24 and today it is 14/04, it is returning like this: 2017-4-15 00:23:24, ie, the day of the month is coming with an extra day and the time is coming 00, do not know why. I wonder what I can change in this case so that the function returns me the correct date and time in 24 hours format.
Already checked the time zone on the server and tried with
date_default_timezone_set
?– Marcelo de Andrade
That’s right, I downloaded the Apache configuration file set the time zone for my region and solved the problem, vlw by help. Then put the answer in the answer box so I can already mark the question as solved.
– Leandro