Arikaim CMS

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

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|null

createFromSeconds()

Create time interval from soconds

public static createFromSeconds(int $seconds) : DateInterval|null
Parameters
$seconds : int
Return values
DateInterval|null

getDateInterval()

Return interval object

public static getDateInterval(mixed $interval) : object
Parameters
$interval : mixed
Return values
object

getDays()

Get days

public static getDays([string|null $interval = null ]) : int
Parameters
$interval : string|null = null
Return values
int

getHours()

Get hours

public static getHours([string|null $interval = null ]) : int
Parameters
$interval : string|null = null
Return values
int

getInterval()

Get date time interval as string

public static getInterval() : string
Return values
string

getMinutes()

Get minutes

public static getMinutes([string|null $interval = null ]) : int
Parameters
$interval : string|null = null
Return values
int

getMonths()

Get months

public static getMonths([string|null $interval = null ]) : int
Parameters
$interval : string|null = null
Return values
int

getYears()

Get years

public static getYears([mixed|null $interval = null ]) : int
Parameters
$interval : mixed|null = null
Return values
int

isDurationInverval()

Return true if text is valid interval string

public static isDurationInverval(string $text) : bool
Parameters
$text : string
Return values
bool

toArray()

Convert interval to array

public static toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results