DateParts
in package
uses
ArrayEnabled
Table of Contents
Properties
Methods
- day() : array<string|int, mixed>|int|string
- DAYOFMONTH.
- month() : array<string|int, mixed>|int|string
- MONTHOFYEAR.
- year() : array<string|int, mixed>|int|string
- YEAR.
- 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.
- initialiseHelper() : void
- testFalse() : bool
- weirdCondition() : int
Properties
$arrayArgumentHelper
private
static ArrayArgumentHelper
$arrayArgumentHelper
$initializationNeeded
private
static bool
$initializationNeeded
= true
Methods
day()
DAYOFMONTH.
public
static day(mixed $dateValue) : array<string|int, mixed>|int|string
Returns the day of the month, for a specified date. The day is given as an integer ranging from 1 to 31.
Excel Function: DAY(dateValue)
Parameters
- $dateValue : mixed
-
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
Return values
array<string|int, mixed>|int|string —Day of the month If an array of numbers is passed as the argument, then the returned result will also be an array with the same dimensions
month()
MONTHOFYEAR.
public
static month(mixed $dateValue) : array<string|int, mixed>|int|string
Returns the month of a date represented by a serial number. The month is given as an integer, ranging from 1 (January) to 12 (December).
Excel Function: MONTH(dateValue)
Parameters
- $dateValue : mixed
-
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
Return values
array<string|int, mixed>|int|string —Month of the year If an array of numbers is passed as the argument, then the returned result will also be an array with the same dimensions
year()
YEAR.
public
static year(mixed $dateValue) : array<string|int, mixed>|int|string
Returns the year corresponding to a date. The year is returned as an integer in the range 1900-9999.
Excel Function: YEAR(dateValue)
Parameters
- $dateValue : mixed
-
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
Return values
array<string|int, mixed>|int|string —Year If an array of numbers is passed as the argument, then the returned result will also be an array with the same 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>initialiseHelper()
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
Return values
boolweirdCondition()
private
static weirdCondition(mixed $dateValue) : int
Parameters
- $dateValue : mixed
-
Excel date serial value (float), PHP date timestamp (integer), PHP DateTime object, or a standard date string