RangeTime
in package
DateTime class.
Table of Contents
- DIFF_INTERVAL_LABELS = ['y' => ['short' => 'LBL_Y', 'plural' => 'LBL_YEARS', 'singular' => 'LBL_YEAR'], 'a' => ['short' => 'LBL_D', 'plural' => 'LBL_DAYS', 'singular' => 'LBL_DAY'], 'h' => ['short' => 'LBL_H', 'plural' => 'LBL_HOURS', 'singular' => 'LBL_HOUR'], 'i' => ['short' => 'LBL_M', 'plural' => 'LBL_MINUTES', 'singular' => 'LBL_MINUTE'], 's' => ['short' => 'LBL_S', 'plural' => 'LBL_SECONDS', 'singular' => 'LBL_SECOND']]
- displayElapseTime() : string
- Get the current interval in a human readable format.
- formatToRangeText() : string
- Function returns the date in user specified format.
- getIntervalPart() : Generator
- Get data interval part.
- myBcmod() : mixed
- myBcmod - get modulus (substitute for bcmod) string my_bcmod ( string left_operand, int modulus ) left_operand can be really big, but be carefull with modulus :( by Andrius Baranauskas and Laurynas Butkus :) Vilnius, Lithuania.
Constants
DIFF_INTERVAL_LABELS
public
array<string|int, mixed>
DIFF_INTERVAL_LABELS
= ['y' => ['short' => 'LBL_Y', 'plural' => 'LBL_YEARS', 'singular' => 'LBL_YEAR'], 'a' => ['short' => 'LBL_D', 'plural' => 'LBL_DAYS', 'singular' => 'LBL_DAY'], 'h' => ['short' => 'LBL_H', 'plural' => 'LBL_HOURS', 'singular' => 'LBL_HOUR'], 'i' => ['short' => 'LBL_M', 'plural' => 'LBL_MINUTES', 'singular' => 'LBL_MINUTE'], 's' => ['short' => 'LBL_S', 'plural' => 'LBL_SECONDS', 'singular' => 'LBL_SECOND']]
Interval labels
Methods
displayElapseTime()
Get the current interval in a human readable format.
public
static displayElapseTime(mixed $interval[, string $formatIn = 'i' ][, string $formatOut = 'ahi' ][, bool $short = true ]) : string
Parameters
- $interval : mixed
- $formatIn : string = 'i'
-
y,h,m,s
- $formatOut : string = 'ahi'
-
ahis - a:days(year), h:hours, i:minutes, s:seconds
- $short : bool = true
Return values
string —formatToRangeText()
Function returns the date in user specified format.
public
static formatToRangeText(string $value[, mixed $mode = 'short' ][, mixed $showEmptyValue = true ][, mixed $unit = 'h' ]) : string
Parameters
- $value : string
-
Date time
- $mode : mixed = 'short'
- $showEmptyValue : mixed = true
- $unit : mixed = 'h'
Return values
string —getIntervalPart()
Get data interval part.
public
static getIntervalPart(DateInterval $dateInterval[, string $formatOut = 'ahis' ]) : Generator
Parameters
- $dateInterval : DateInterval
- $formatOut : string = 'ahis'
Return values
Generator —myBcmod()
myBcmod - get modulus (substitute for bcmod) string my_bcmod ( string left_operand, int modulus ) left_operand can be really big, but be carefull with modulus :( by Andrius Baranauskas and Laurynas Butkus :) Vilnius, Lithuania.
private
static myBcmod(mixed $x, mixed $y) : mixed
Parameters
- $x : mixed
- $y : mixed