Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401]

(no description)

File Size: 151 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

DateParts:: (4 methods):
  day()
  month()
  year()
  weirdCondition()


Class: DateParts  - X-Ref

day($dateValue)   X-Ref
DAYOFMONTH.

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)

param: mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
return: array|int|string Day of the month

month($dateValue)   X-Ref
MONTHOFYEAR.

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)

param: mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
return: array|int|string Month of the year

year($dateValue)   X-Ref
YEAR.

Returns the year corresponding to a date.
The year is returned as an integer in the range 1900-9999.

Excel Function:
YEAR(dateValue)

param: mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
return: array|int|string Year

weirdCondition($dateValue)   X-Ref

param: mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),