Date function returning day of month and incorrect time [duplicate]

2

I am trying to capture the date and time to check the time the user has gone without doing any action on the system, however I am having problems with the PHP date function. The code is as follows:

$agora = date("Y-n-j H:i:s");

However, it is returning the day of the month and the time incorrectly. At this very moment it's 19:24 and today it's 14/04, it's returning like this: 2017-4-15 00:23:24, meaning the day of the month is coming with an extra day and the time is coming 00 , I do not know why. I would like to know what I can change in this case for the function to return the correct date and time in 24 hour format.

    
asked by anonymous 15.04.2017 / 00:26

0 answers