InteractsWithTime
Table of Contents
Methods
- availableAt() : int
- Get the "available at" UNIX timestamp.
- currentTime() : int
- Get the current system time as a UNIX timestamp.
- parseDateInterval() : DateInterval|DateTimeInterface|int
- If the given value is an interval, convert it to a DateTime instance.
- runTimeForHumans() : string
- Given a start time, format the total run time for human readability.
- secondsUntil() : int
- Get the number of seconds until the given DateTime.
Methods
availableAt()
Get the "available at" UNIX timestamp.
protected
availableAt([DateInterval|DateTimeInterface|int $delay = 0 ]) : int
Parameters
- $delay : DateInterval|DateTimeInterface|int = 0
Return values
intcurrentTime()
Get the current system time as a UNIX timestamp.
protected
currentTime() : int
Return values
intparseDateInterval()
If the given value is an interval, convert it to a DateTime instance.
protected
parseDateInterval(DateInterval|DateTimeInterface|int $delay) : DateInterval|DateTimeInterface|int
Parameters
- $delay : DateInterval|DateTimeInterface|int
Return values
DateInterval|DateTimeInterface|intrunTimeForHumans()
Given a start time, format the total run time for human readability.
protected
runTimeForHumans(float $startTime[, float|null $endTime = null ]) : string
Parameters
- $startTime : float
- $endTime : float|null = null
Tags
Return values
stringsecondsUntil()
Get the number of seconds until the given DateTime.
protected
secondsUntil(DateInterval|DateTimeInterface|int $delay) : int
Parameters
- $delay : DateInterval|DateTimeInterface|int