You're attempting to use strtotime()
multiple times.
The issue can be reproduced with the code below:
$fechaactual = strtotime('now');
$pelo = date("d/m G:i:s",$fechaactual);
$timestamp2 = strtotime($pelo);
var_dump($timestamp2);
Outputs:
bool(false)
$fechaactual
will contain the timestamp for the current time, and by using date()
, you're converting the timestamp into a readable format. Later, you're trying to use strtotime()
on the new date string, but strtotime()
fails to understand that format and returns FALSE
.
strtotime()
understands the formats listed in this page: http://php.net/manual/en/datetime.formats.date.php
If you want to parse a date string with a custom format, it's better to use DateTime::createFromFormat()
instead: