Documentation

IntervalSpec
in package
uses CloneWith

FinalYes

IntervalSpec matches times that can be expressed as: epoch + n * interval + phase where n is an integer.

self::$pahse defaults to zero if missing. self::$interval is required. Both interval and phase must be non-negative and are truncated to the nearest second before any calculations. For example, an interval of 1 hour with phase of zero would match every hour, on the hour. The same interval but a phase of 19 minutes would match every xx:19:00. An interval of 28 days with phase zero would match 2022-02-17T00:00:00Z (among other times). The same interval with a phase of 3 days, 5 hours, and 23 minutes would match 2022-02-20T05:23:00Z instead.

Tags
see
IntervalSpec

Table of Contents

Properties

$interval  : DateInterval
$phase  : DateInterval

Methods

new()  : self
withInterval()  : self
withPhase()  : self
__construct()  : mixed

Properties

Methods

new()

public static new(mixed $interval[, mixed $phase = null ]) : self
Parameters
$interval : mixed
$phase : mixed = null
Return values
self

withInterval()

public withInterval(mixed $interval) : self
Parameters
$interval : mixed
Return values
self

withPhase()

public withPhase(mixed $phase) : self
Parameters
$phase : mixed
Return values
self

__construct()

private __construct(DateInterval $interval, DateInterval $phase) : mixed
Parameters
$interval : DateInterval
$phase : DateInterval

        
On this page

Search results