PHP Class Knp\Bundle\TimeBundle\Templating\Helper\TimeHelper

Inheritance: extends Symfony\Component\Templating\Helper\Helper
Show file Open project: KnpLabs/KnpTimeBundle

Protected Properties

Property Type Description
$formatter

Public Methods

Method Description
__construct ( DateTimeFormatter $formatter )
diff ( $from, $to = null ) : string Returns a single number of years, months, days, hours, minutes or seconds between the specified date times.
getDatetimeObject ( mixed $datetime = null ) : DateTimeInterfac\DateTimeInterface Returns a DateTime instance for the given datetime
getName ( )

Method Details

__construct() public method

public __construct ( DateTimeFormatter $formatter )
$formatter Knp\Bundle\TimeBundle\DateTimeFormatter

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

getDatetimeObject() public method

Returns a DateTime instance for the given datetime
public getDatetimeObject ( mixed $datetime = null ) : DateTimeInterfac\DateTimeInterface
$datetime mixed
return DateTimeInterfac\DateTimeInterface

getName() public method

public getName ( )

Property Details

$formatter protected property

protected $formatter