Days360
in package
uses
ArrayEnabled
Table of Contents
Properties
Methods
- between() : array<string|int, mixed>|int|string
- DAYS360.
- evaluateArrayArguments() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument.
- evaluateArrayArgumentsIgnore() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument except for the one specified by ignore.
- evaluateArrayArgumentsSubset() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, but only the first few (up to limit) can be an array arguments.
- evaluateArrayArgumentsSubsetFrom() : array<string|int, mixed>
- Handles array argument processing when the function accepts multiple arguments, but only the last few (from start) can be an array arguments.
- evaluateSingleArgumentArray() : array<string|int, mixed>
- Handles array argument processing when the function accepts a single argument that can be an array argument.
- dateDiff360() : int
- Return the number of days between two dates based on a 360 day calendar.
- getEndDay() : int
- getStartDay() : int
- initialiseHelper() : void
- testFalse() : bool
Properties
$arrayArgumentHelper
private
static ArrayArgumentHelper
$arrayArgumentHelper
$initializationNeeded
private
static bool
$initializationNeeded
= true
Methods
between()
DAYS360.
public
static between([array<string|int, mixed>|mixed $startDate = 0 ][, array<string|int, mixed>|mixed $endDate = 0 ][, array<string|int, mixed>|mixed $method = false ]) : array<string|int, mixed>|int|string
Returns the number of days between two dates based on a 360-day year (twelve 30-day months), which is used in some accounting calculations. Use this function to help compute payments if your accounting system is based on twelve 30-day months.
Excel Function: DAYS360(startDate,endDate[,method])
Parameters
- $startDate : array<string|int, mixed>|mixed = 0
-
Excel date serial value (float), PHP date timestamp (integer), PHP DateTime object, or a standard date string Or can be an array of date values
- $endDate : array<string|int, mixed>|mixed = 0
-
Excel date serial value (float), PHP date timestamp (integer), PHP DateTime object, or a standard date string Or can be an array of date values
- $method : array<string|int, mixed>|mixed = false
-
US or European Method as a bool FALSE or omitted: U.S. (NASD) method. If the starting date is the last day of a month, it becomes equal to the 30th of the same month. If the ending date is the last day of a month and the starting date is earlier than the 30th of a month, the ending date becomes equal to the 1st of the next month; otherwise the ending date becomes equal to the 30th of the same month. TRUE: European method. Starting dates and ending dates that occur on the 31st of a month become equal to the 30th of the same month. Or can be an array of methods
Return values
array<string|int, mixed>|int|string —Number of days between start date and end date If an array of values is passed for the $startDate or $endDays,arguments, then the returned result will also be an array with matching dimensions
evaluateArrayArguments()
Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument.
protected
static evaluateArrayArguments(callable $method, mixed ...$arguments) : array<string|int, mixed>
Example use for: ROUND() or DATE().
Parameters
- $method : callable
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsIgnore()
Handles array argument processing when the function accepts multiple arguments, and any of them can be an array argument except for the one specified by ignore.
protected
static evaluateArrayArgumentsIgnore(callable $method, int $ignore, mixed ...$arguments) : array<string|int, mixed>
Example use for: HLOOKUP() and VLOOKUP(), where argument 1 is a matrix that needs to be treated as a database rather than as an array argument.
Parameters
- $method : callable
- $ignore : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsSubset()
Handles array argument processing when the function accepts multiple arguments, but only the first few (up to limit) can be an array arguments.
protected
static evaluateArrayArgumentsSubset(callable $method, int $limit, mixed ...$arguments) : array<string|int, mixed>
Example use for: NETWORKDAYS() or CONCATENATE(), where the last argument is a matrix (or a series of values) that need to be treated as a such rather than as an array arguments.
Parameters
- $method : callable
- $limit : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateArrayArgumentsSubsetFrom()
Handles array argument processing when the function accepts multiple arguments, but only the last few (from start) can be an array arguments.
protected
static evaluateArrayArgumentsSubsetFrom(callable $method, int $start, mixed ...$arguments) : array<string|int, mixed>
Example use for: Z.TEST() or INDEX(), where the first argument 1 is a matrix that needs to be treated as a dataset rather than as an array argument.
Parameters
- $method : callable
- $start : int
- $arguments : mixed
Return values
array<string|int, mixed>evaluateSingleArgumentArray()
Handles array argument processing when the function accepts a single argument that can be an array argument.
protected
static evaluateSingleArgumentArray(callable $method, array<string|int, mixed> $values) : array<string|int, mixed>
Example use for: DAYOFMONTH() or FACT().
Parameters
- $method : callable
- $values : array<string|int, mixed>
Return values
array<string|int, mixed>dateDiff360()
Return the number of days between two dates based on a 360 day calendar.
private
static dateDiff360(int $startDay, int $startMonth, int $startYear, int $endDay, int $endMonth, int $endYear, bool $methodUS) : int
Parameters
- $startDay : int
- $startMonth : int
- $startYear : int
- $endDay : int
- $endMonth : int
- $endYear : int
- $methodUS : bool
Return values
intgetEndDay()
private
static getEndDay(int $endDay, int &$endMonth, int &$endYear, int $startDay, bool $methodUS) : int
Parameters
- $endDay : int
- $endMonth : int
- $endYear : int
- $startDay : int
- $methodUS : bool
Return values
intgetStartDay()
private
static getStartDay(int $startDay, int $startMonth, int $startYear, bool $methodUS) : int
Parameters
- $startDay : int
- $startMonth : int
- $startYear : int
- $methodUS : bool
Return values
intinitialiseHelper()
private
static initialiseHelper(array<string|int, mixed>|false $arguments) : void
Parameters
- $arguments : array<string|int, mixed>|false
-
Can be changed to array for Php8.1+
testFalse()
private
static testFalse(mixed $value) : bool
Parameters
- $value : mixed