$now = new DateTime();
$date = DateTime::createFromFormat("Y-m-d H:i", '2017-01-18 00:00');
$interval = $now->diff($date);
$years = $interval->y;
function grammar($number, $forms)
{
assert(count($forms) === 3);
$nn = abs((abs($number % 100) < 21) ? ($number % 100) : ($number % 10));
return (($nn == 1) ? $forms[0] : (($nn > 1 && $nn < 5) ? $forms[1] : $forms[2]));
}
echo $years . grammar($years, [' год', ' года', ' лет']);