year, quarter, month, day

Prev Next

Function Names

year, quarter, month, day

Description

These 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

Call as: function

Restrictions

Indirect parameter passing is disabled

Parameter count

1

Parameters

No.TypeDescription
1
input
date or string converted to date Date

Value to extract as described above

Return value

TypeDescription
numeral Result

Returned value as described above

Examples

      a[] = "14. July 2020, 15:30:40";
      echo( year( a[] ), ", ", quarter( a[] ), ", ", month( a[] ), ", ", day( a[] ) );

Output

2020, 3, 7, 14
Try it yourself: Open LIB_Function_year.b4p in B4P_Examples.zip. Decompress before use.

See also

Time info functions
day of year
serial date
fy
fq