DurationFormatter
Table of Contents
Constants
-
DAYS
= 31
-
DAYS_YEAR
= 365
-
HALF_DAYS
= self::DAYS / 2
-
HALF_HOURS
= self::HOURS / 2
-
HALF_MINUTES
= self::MINUTES / 2
-
HALF_MONTHS
= self::MONTHS / 2
-
HALF_SECONDS
= self::SECONDS / 2
-
HOURS
= 24
-
MINUTES
= 60
-
MONTHS
= 12
-
SECONDS
= 60
Methods
-
format()
: string|null
-
getSecondsFromDays()
: int
-
getSecondsFromHours()
: int
-
getSecondsFromMinutes()
: int
-
getSecondsFromMonths()
: int
-
getSecondsFromYears()
: int
-
getUnitMod()
: array<string|int, mixed>
-
roundTimeInSeconds()
: int
-
roundUpTimeInSeconds()
: int
DAYS
public
mixed
DAYS
= 31
DAYS_YEAR
public
mixed
DAYS_YEAR
= 365
HALF_DAYS
public
mixed
HALF_DAYS
= self::DAYS / 2
HALF_HOURS
public
mixed
HALF_HOURS
= self::HOURS / 2
HALF_MINUTES
public
mixed
HALF_MINUTES
= self::MINUTES / 2
HALF_MONTHS
public
mixed
HALF_MONTHS
= self::MONTHS / 2
HALF_SECONDS
public
mixed
HALF_SECONDS
= self::SECONDS / 2
HOURS
public
mixed
HOURS
= 24
MINUTES
public
mixed
MINUTES
= 60
MONTHS
public
mixed
MONTHS
= 12
SECONDS
public
mixed
SECONDS
= 60
public
static format(int $duration) : string|null
Parameters
-
$duration
: int
-
Return values
string|null
getSecondsFromDays()
public
static getSecondsFromDays(int $days) : int
Parameters
-
$days
: int
-
getSecondsFromHours()
public
static getSecondsFromHours(int $hours) : int
Parameters
-
$hours
: int
-
getSecondsFromMinutes()
public
static getSecondsFromMinutes(int $minutes) : int
Parameters
-
$minutes
: int
-
getSecondsFromMonths()
public
static getSecondsFromMonths(int $months) : int
Parameters
-
$months
: int
-
getSecondsFromYears()
public
static getSecondsFromYears(int $years) : int
Parameters
-
$years
: int
-
getUnitMod()
public
static getUnitMod(int $seconds) : array<string|int, mixed>
Parameters
-
$seconds
: int
-
Return values
array<string|int, mixed>
roundTimeInSeconds()
public
static roundTimeInSeconds(int $timeInSeconds) : int
Parameters
-
$timeInSeconds
: int
-
roundUpTimeInSeconds()
public
static roundUpTimeInSeconds(int $timeInSeconds) : int
Parameters
-
$timeInSeconds
: int
-