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
Table of Contents
Properties
Methods
- new() : self
- withInterval() : self
- withPhase() : self
- __construct() : mixed
Properties
$interval read-only
public
DateInterval
$interval
$phase read-only
public
DateInterval
$phase
Methods
new()
public
static new(mixed $interval[, mixed $phase = null ]) : self
Parameters
- $interval : mixed
- $phase : mixed = null
Return values
selfwithInterval()
public
withInterval(mixed $interval) : self
Parameters
- $interval : mixed
Return values
selfwithPhase()
public
withPhase(mixed $phase) : self
Parameters
- $phase : mixed
Return values
self__construct()
private
__construct(DateInterval $interval, DateInterval $phase) : mixed
Parameters
- $interval : DateInterval
- $phase : DateInterval