LinkedIn work history time
If you already parse the date string using DateTime, then it's better to format using that resulting date object instead of parsing again with strtotime, for example:

$startDate = new DateTime($this-&gt;start_date);
$startPretty = $startDate-&gt;format('F Y');


If $current is true, then there's no need to parse $this-&gt;end_date.
You can move that to the else block instead:

if($current) // currently works at this job
{
    $endDate = new DateTime(); // current date/time
    $endPretty = 'Present';
}
else
{
    $endDate = new DateTime($this-&gt;end_date);
    $endPretty = $endDate-&gt;format('F Y');
}


These conditions don't do what you think they do:


if($diff-&gt;y = 0)
{
    // ...
}
elseif ($diff-&gt;y = 1)
{
    // ... 
}



The = operator assigns. This is not a check for equality.
The result of an assignment is the assigned value.
So the above statements are actually evaluated like this:


if(0)  // always false, $diff-&gt;y was set to 0, no matter what it was before
{
    // ...
}
elseif (1)  // always true, $diff-&gt;y was set to 1, no matter what it was before
{
    // ...
}



That is, first $diff-&gt;y is set to 0, the expression evaluates to false,
then in the elseif, $diff-&gt;y is set to 1, the expression evaluates to true.
To see the problem, set start_date to 2 or more years before end_date.
The result will always be 1 year difference instead of 2, 3 or more.

What you really wanted is the equals operator == like this:

if($diff-&gt;y == 0)
{
    // ...
}
elseif ($diff-&gt;y == 1)
{
    // ... 
}