Home > Mobile >  PHP date function stuck at 11 minutes
PHP date function stuck at 11 minutes

Time:11-12

When I run this code:

$time = time();
echo "$time<br>";
echo date("H:m \a\\t d/m/Y", $time);

It echos:

1668166632
11:11 at 11/11/2022

But the expected result is:

1668166632
12:37 at 11/11/2022

This happens until the next hour which it changes to 12:11.
How do I fix this?

CodePudding user response:

One issue, I am seeing is in your statement H:m m represents the month, to get the value of minute use H:i

echo date("H:i \a\\t d/m/Y", $time); 
  • Related