ReadableDuration
Table of Contents
Constants
-
DAYS_PER_MONTH
= 30.44
-
DAYS_PER_YEAR
= 365.25
-
HOURS_PER_DAY
= 24
-
INTERVAL_DAY_KEY
= 'd'
-
INTERVAL_HOUR_KEY
= 'h'
-
INTERVAL_MINUTE_KEY
= 'i'
-
INTERVAL_MONTH_KEY
= 'm'
-
INTERVAL_SECOND_KEY
= 's'
-
INTERVAL_YEAR_KEY
= 'y'
-
MAX_APPROPRIATE_UNITS_PRECISION
= 6
-
MINUTES_PER_HOUR
= 60
-
MONTHS_PER_YEAR
= 12
-
SECONDS_PER_MINUTE
= 60
-
UNIT_DAY
= 'day'
-
UNIT_HOUR
= 'hour'
-
UNIT_MINUTE
= 'minute'
-
UNIT_MONTH
= 'month'
-
UNIT_SECOND
= 'second'
-
UNIT_YEAR
= 'year'
Properties
-
$comparatorTime
: DateTime
-
$currentTime
: DateTime
-
$interval
: DateInterval
-
$unitsToIntervalUnits
: mixed
-
$unitThresholds
: mixed
-
$valueInSeconds
: int
Methods
-
__construct()
: mixed
-
getDays()
: int
-
getHours()
: int
-
getInDays()
: float
-
getInHours()
: float
-
getInMinutes()
: float
-
getInMonths()
: float
-
getInMostAppropriateUnits()
: mixed
-
getInSeconds()
: int
-
getInYears()
: float
-
getMinutes()
: int
-
getMonths()
: int
-
getRoundedDays()
: int
-
getRoundedHours()
: int
-
getRoundedMinutes()
: int
-
getRoundedMonths()
: int
-
getRoundedYears()
: int
-
getSeconds()
: int
-
getYears()
: int
-
isFuture()
: bool
-
isPast()
: bool
-
isPresent()
: bool
-
setValueInSeconds()
: ReadableDuration
-
getInterval()
: DateInterval
-
getLargestIntervalUnit()
: mixed
-
getSecondsPerDay()
: int
-
getSecondsPerHour()
: int
-
getSecondsPerMonth()
: int
-
getSecondsPerYear()
: int
-
roundUpUnitValues()
: mixed
DAYS_PER_MONTH
public
mixed
DAYS_PER_MONTH
= 30.44
DAYS_PER_YEAR
public
mixed
DAYS_PER_YEAR
= 365.25
HOURS_PER_DAY
public
mixed
HOURS_PER_DAY
= 24
INTERVAL_DAY_KEY
public
mixed
INTERVAL_DAY_KEY
= 'd'
INTERVAL_HOUR_KEY
public
mixed
INTERVAL_HOUR_KEY
= 'h'
INTERVAL_MINUTE_KEY
public
mixed
INTERVAL_MINUTE_KEY
= 'i'
INTERVAL_MONTH_KEY
public
mixed
INTERVAL_MONTH_KEY
= 'm'
INTERVAL_SECOND_KEY
public
mixed
INTERVAL_SECOND_KEY
= 's'
INTERVAL_YEAR_KEY
public
mixed
INTERVAL_YEAR_KEY
= 'y'
MAX_APPROPRIATE_UNITS_PRECISION
public
mixed
MAX_APPROPRIATE_UNITS_PRECISION
= 6
MINUTES_PER_HOUR
public
mixed
MINUTES_PER_HOUR
= 60
MONTHS_PER_YEAR
public
mixed
MONTHS_PER_YEAR
= 12
SECONDS_PER_MINUTE
public
mixed
SECONDS_PER_MINUTE
= 60
UNIT_DAY
public
mixed
UNIT_DAY
= 'day'
UNIT_HOUR
public
mixed
UNIT_HOUR
= 'hour'
UNIT_MINUTE
public
mixed
UNIT_MINUTE
= 'minute'
UNIT_MONTH
public
mixed
UNIT_MONTH
= 'month'
UNIT_SECOND
public
mixed
UNIT_SECOND
= 'second'
UNIT_YEAR
public
mixed
UNIT_YEAR
= 'year'
$comparatorTime
private
DateTime
$comparatorTime
= null
$currentTime
private
DateTime
$currentTime
= null
$interval
private
DateInterval
$interval
= null
$unitsToIntervalUnits
private
mixed
$unitsToIntervalUnits
= array(self::UNIT_YEAR => self::INTERVAL_YEAR_KEY, self::UNIT_MONTH => self::INTERVAL_MONTH_KEY, self::UNIT_DAY => self::INTERVAL_DAY_KEY, self::UNIT_HOUR => self::INTERVAL_HOUR_KEY, self::UNIT_MINUTE => self::INTERVAL_MINUTE_KEY, self::UNIT_SECOND => self::INTERVAL_SECOND_KEY)
$unitThresholds
private
mixed
$unitThresholds
= array(self::UNIT_MONTH => self::MONTHS_PER_YEAR, self::UNIT_DAY => self::DAYS_PER_MONTH, self::UNIT_HOUR => self::HOURS_PER_DAY, self::UNIT_MINUTE => self::MINUTES_PER_HOUR, self::UNIT_SECOND => self::SECONDS_PER_MINUTE)
$valueInSeconds
private
int
$valueInSeconds
= 0
__construct()
public
__construct([type $valueInSeconds = null ]) : mixed
Parameters
-
$valueInSeconds
: type
= null
-
getDays()
public
getDays() : int
getHours()
public
getHours() : int
getInDays()
public
getInDays() : float
getInHours()
public
getInHours() : float
getInMinutes()
public
getInMinutes() : float
getInMonths()
public
getInMonths() : float
getInMostAppropriateUnits()
public
getInMostAppropriateUnits([mixed $precision = 1 ]) : mixed
Parameters
-
$precision
: mixed
= 1
-
getInSeconds()
public
getInSeconds() : int
getInYears()
public
getInYears() : float
getMinutes()
public
getMinutes() : int
getMonths()
public
getMonths() : int
getRoundedDays()
public
getRoundedDays() : int
getRoundedHours()
public
getRoundedHours() : int
getRoundedMinutes()
public
getRoundedMinutes() : int
getRoundedMonths()
public
getRoundedMonths() : int
getRoundedYears()
public
getRoundedYears() : int
getSeconds()
public
getSeconds() : int
getYears()
public
getYears() : int
isFuture()
public
isFuture() : bool
isPast()
public
isPast() : bool
isPresent()
public
isPresent() : bool
setValueInSeconds()
public
setValueInSeconds(type $valueInSeconds) : ReadableDuration
Parameters
-
$valueInSeconds
: type
-
getInterval()
private
getInterval() : DateInterval
Return values
DateInterval
getLargestIntervalUnit()
private
getLargestIntervalUnit() : mixed
getSecondsPerDay()
private
getSecondsPerDay() : int
getSecondsPerHour()
private
getSecondsPerHour() : int
getSecondsPerMonth()
private
getSecondsPerMonth() : int
getSecondsPerYear()
private
getSecondsPerYear() : int
roundUpUnitValues()
private
roundUpUnitValues(mixed $unitValues) : mixed
Parameters
-
$unitValues
: mixed
-