I found this:
$minutes = (strtotime("2012-09-21 12:12:22") - time()) / 60;
But the string from the API that I took is like 06-09-19 | 16:23:17 and this code don't work at all.
How can I do?
Thanks.
You'll need to manually parse that date format as it is non-standard using DateTime::createFromFormat
:
$date = DateTime::createFromFormat('d-m-y \| H:i:s', '06-09-19 | 16:23:17');
$minutes = ( $date->format('U')-time() ) / 60;