Returns an instance with the current local time and the local time zone.
Returns an instance with the current local time and the local time zone.
Note: Subsequent calls return equal times, event if they are minutes apart. now
actually refers to the REQUEST_TIME or, if it is now available, to the first time
the method was invoked.
public
change( array$options, boolean$cascade = false )
: ICanBoogie\DateTime
Modifies the properties of the instance according to the options.
Modifies the properties of the instance according to the options.
The following properties can be updated: $year, $month, $day,
$hour, $minute and $second.
Note: Values exceeding ranges are added to their parent values.
<?phpuse ICanBoogie\ImmutableDateTime as DateTime;
$time = new DateTime('now');
$time->change([ 'year' => 2000, 'second' => 0 ]);
Parameters
$options
$cascade
If true, time options (hour, minute, second) reset
cascading, so if only the hour is passed, then minute and second is set to 0. If the hour
and minute is passed, then second is set to 0.