PHP 클래스 Cake\Chronos\DifferenceFormatter

Provides a swappable component for other libraries to leverage. when localizing or customizing the difference output.
파일 보기 프로젝트 열기: cakephp/chronos

공개 메소드들

메소드 설명
__construct ( Translator | null $translate = null ) Constructor.
diffForHumans ( Cake\Chronos\ChronosInterface $date, Cake\Chronos\ChronosInterface $other = null, boolean $absolute = false ) : string Get the difference in a human readable format.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Translator | null $translate = null )
$translate Translator | null The text translator object.

diffForHumans() 공개 메소드

Get the difference in a human readable format.
또한 보기: Cake\Chronos\ChronosInterface::diffForHumans
public diffForHumans ( Cake\Chronos\ChronosInterface $date, Cake\Chronos\ChronosInterface $other = null, boolean $absolute = false ) : string
$date Cake\Chronos\ChronosInterface The datetime to start with.
$other Cake\Chronos\ChronosInterface The datetime to compare against.
$absolute boolean removes time difference modifiers ago, after, etc
리턴 string The difference between the two days in a human readable format