PHP Trait Elgg\TimeUsing

Show file Open project: elgg/elgg

Public Methods

Method Description
getCurrentTime ( string $modifier = '' ) : DateTime Get the (cloned) time. If setCurrentTime() has not been set, this will return a new DateTime().
setCurrentTime ( DateTime $time = null ) : void Set the current time.

Method Details

getCurrentTime() public method

Get the (cloned) time. If setCurrentTime() has not been set, this will return a new DateTime().
See also: DateTime::modify
public getCurrentTime ( string $modifier = '' ) : DateTime
$modifier string Time modifier
return DateTime

setCurrentTime() public method

Set the current time.
public setCurrentTime ( DateTime $time = null ) : void
$time DateTime Current time (empty for now)
return void