- abs: documentation ( source)
- time: documentation ( source)
- round: documentation ( source)
- mktime: documentation ( source)
- date_parse_from_format: documentation ( source)
<?php
$date = date_parse_from_format('Y-d-m H:i:s', '2014-02-05 5:22:35');
$unixTimestamp = mktime(
$date['hour'], $date['minute'], $date['second'],
$date['month'], $date['day'], $date['year']
);
$now = time();
echo round(abs($now - $unixTimestamp) / 60,2). " minutes ago";