I'm trying to subtract 15 minutes date()
from the following way, but it doesn't work, the output is something like 1593076260
$nowHour = date("H:i");
$nowHour = strtotime('-15 minute', strtotime($nowHour));
I'm trying to subtract 15 minutes date()
from the following way, but it doesn't work, the output is something like 1593076260
$nowHour = date("H:i");
$nowHour = strtotime('-15 minute', strtotime($nowHour));
You could also use
DateTime
for this.For example, you can create an object directly with the time 15 minutes ago :
Departure:
If you want to do it with anyway, you do
strtotime
n't need to double use the function, you can simplify like this:P.S:
In
DateTime
notation also works- valor
, for example:I found the solution by adding this line, which transforms to
date()