year, quarter, month, dayThese functions extract specific numeric info of the dates. 0 is returned if the input value contains no recognizable date.
| Function Name | Result |
|---|---|
| year | 4-digit year |
| quarter | quarters 1-4 |
| month | months 1-12 |
| day | day in month 1-31 |
Vectorization: These functions support vectorization in the 1st function parameter.
Instead of providing a single value, you can provide a set or even a nested set which contain multiple values.
The function will then process every value and its return value contains a corresponding set containing all results.
Indirect parameter passing is disabled
Vectorization is allowed in the 1st function parameter
1
| No. | Type | Description |
|---|---|---|
| 1 input |
date or string converted to date set |
Date Value to extract as described above. Vectorization: Put multiple values into a (nested) set. |
| Type | Description |
|---|---|
| numeral set |
Result Returned value(s) as described above |
a[] = "14. July 2020, 15:30:40";
echo( year( a[] ), ", ", quarter( a[] ), ", ", month( a[] ), ", ", day( a[] ) );
echo( year( { today, '14.07.2025' } )); // Vectorization example with 2 dates2020, 3, 7, 14
{2025,2025}