Documentation

Helpers

Table of Contents

adjustDateByMonths()  : DateTime
Adjust date by given months.
adjustYear()  : void
Adjust year in ambiguous situations.
dateParse()  : array<string|int, mixed>
dateParseSucceeded()  : bool
getDateValue()  : float
getDateValue.
getTimeValue()  : mixed
getTimeValue.
isLeapYear()  : bool
Identify if a year is a leap year or not.
nullFalseTrueToNumber()  : void
Many functions accept null/false/true argument treated as 0/0/1.
replaceIfEmpty()  : void
Help reduce perceived complexity of some tests.
returnIn3FormatsArray()  : mixed
Return result in one of three formats.
returnIn3FormatsFloat()  : mixed
Return result in one of three formats.
returnIn3FormatsObject()  : mixed
Return result in one of three formats.
silly1900()  : void
validateNotNegative()  : float
Many functions accept null/false/true argument treated as 0/0/1.
validateNumericNull()  : float|int
Many functions accept null argument treated as 0.
baseDate()  : int
forceArray()  : array<string|int, mixed>
Despite documentation, date_parse probably never returns false.

Methods

adjustDateByMonths()

Adjust date by given months.

public static adjustDateByMonths(mixed $dateValue, float $adjustmentMonths) : DateTime
Parameters
$dateValue : mixed
$adjustmentMonths : float
Return values
DateTime

adjustYear()

Adjust year in ambiguous situations.

public static adjustYear(string $testVal1, string $testVal2, string &$testVal3) : void
Parameters
$testVal1 : string
$testVal2 : string
$testVal3 : string
Return values
void

dateParse()

public static dateParse(string $string) : array<string|int, mixed>
Parameters
$string : string
Return values
array<string|int, mixed>

dateParseSucceeded()

public static dateParseSucceeded(array<string|int, mixed> $dateArray) : bool
Parameters
$dateArray : array<string|int, mixed>
Return values
bool

getDateValue()

getDateValue.

public static getDateValue(mixed $dateValue[, bool $allowBool = true ]) : float
Parameters
$dateValue : mixed
$allowBool : bool = true
Return values
float

Excel date/time serial value

getTimeValue()

getTimeValue.

public static getTimeValue(string $timeValue) : mixed
Parameters
$timeValue : string
Return values
mixed

Excel date/time serial value, or string if error

isLeapYear()

Identify if a year is a leap year or not.

public static isLeapYear(int|string $year) : bool
Parameters
$year : int|string

The year to test

Return values
bool

TRUE if the year is a leap year, otherwise FALSE

nullFalseTrueToNumber()

Many functions accept null/false/true argument treated as 0/0/1.

public static nullFalseTrueToNumber(mixed &$number[, bool $allowBool = true ]) : void
Parameters
$number : mixed
$allowBool : bool = true
Return values
void

replaceIfEmpty()

Help reduce perceived complexity of some tests.

public static replaceIfEmpty(mixed &$value, mixed $altValue) : void
Parameters
$value : mixed
$altValue : mixed
Return values
void

returnIn3FormatsArray()

Return result in one of three formats.

public static returnIn3FormatsArray(array<string|int, mixed> $dateArray[, bool $noFrac = false ]) : mixed
Parameters
$dateArray : array<string|int, mixed>
$noFrac : bool = false
Return values
mixed

returnIn3FormatsFloat()

Return result in one of three formats.

public static returnIn3FormatsFloat(float $excelDateValue) : mixed
Parameters
$excelDateValue : float
Return values
mixed

returnIn3FormatsObject()

Return result in one of three formats.

public static returnIn3FormatsObject(DateTime $PHPDateObject) : mixed
Parameters
$PHPDateObject : DateTime
Return values
mixed

silly1900()

public static silly1900(DateTime $PHPDateObject[, string $mod = '-1 day' ]) : void
Parameters
$PHPDateObject : DateTime
$mod : string = '-1 day'
Return values
void

validateNotNegative()

Many functions accept null/false/true argument treated as 0/0/1.

public static validateNotNegative(mixed $number) : float
Parameters
$number : mixed
Return values
float

validateNumericNull()

Many functions accept null argument treated as 0.

public static validateNumericNull(mixed $number) : float|int
Parameters
$number : mixed
Return values
float|int

baseDate()

private static baseDate() : int
Return values
int

forceArray()

Despite documentation, date_parse probably never returns false.

private static forceArray(array<string|int, mixed>|false $dateArray) : array<string|int, mixed>

Just in case, this routine helps guarantee it.

Parameters
$dateArray : array<string|int, mixed>|false
Return values
array<string|int, mixed>

Search results