Knp\Bundle\TimeBundle\Templating\Helper\TimeHelper::diff PHP Method

diff() public method

Returns a single number of years, months, days, hours, minutes or seconds between the specified date times.
public diff ( $from, $to = null ) : string
return string
    public function diff($from, $to = null)
    {
        $from = $this->getDatetimeObject($from);
        $to = $this->getDatetimeObject($to);
        return $this->formatter->formatDiff($from, $to);
    }