TimeInterval
in package
Time intervals
Table of Contents
Constants
- TYPE_CRONTAB = 1
- TYPE_ISO_8601 = 0
Properties
- $interval : object
- Interval obj
Methods
- create() : DateInterval|null
- Create interval
- createFromSeconds() : DateInterval|null
- Create time interval from soconds
- getDateInterval() : object
- Return interval object
- getDays() : int
- Get days
- getHours() : int
- Get hours
- getInterval() : string
- Get date time interval as string
- getMinutes() : int
- Get minutes
- getMonths() : int
- Get months
- getYears() : int
- Get years
- isDurationInverval() : bool
- Return true if text is valid interval string
- toArray() : array<string|int, mixed>
- Convert interval to array
Constants
TYPE_CRONTAB
public
mixed
TYPE_CRONTAB
= 1
TYPE_ISO_8601
public
mixed
TYPE_ISO_8601
= 0
Properties
$interval
Interval obj
private
static object
$interval
= null
Methods
create()
Create interval
public
static create(mixed $interval) : DateInterval|null
Parameters
- $interval : mixed
Return values
DateInterval|nullcreateFromSeconds()
Create time interval from soconds
public
static createFromSeconds(int $seconds) : DateInterval|null
Parameters
- $seconds : int
Return values
DateInterval|nullgetDateInterval()
Return interval object
public
static getDateInterval(mixed $interval) : object
Parameters
- $interval : mixed
Return values
objectgetDays()
Get days
public
static getDays([string|null $interval = null ]) : int
Parameters
- $interval : string|null = null
Return values
intgetHours()
Get hours
public
static getHours([string|null $interval = null ]) : int
Parameters
- $interval : string|null = null
Return values
intgetInterval()
Get date time interval as string
public
static getInterval() : string
Return values
stringgetMinutes()
Get minutes
public
static getMinutes([string|null $interval = null ]) : int
Parameters
- $interval : string|null = null
Return values
intgetMonths()
Get months
public
static getMonths([string|null $interval = null ]) : int
Parameters
- $interval : string|null = null
Return values
intgetYears()
Get years
public
static getYears([mixed|null $interval = null ]) : int
Parameters
- $interval : mixed|null = null
Return values
intisDurationInverval()
Return true if text is valid interval string
public
static isDurationInverval(string $text) : bool
Parameters
- $text : string
Return values
booltoArray()
Convert interval to array
public
static toArray() : array<string|int, mixed>