Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 400 and 403] [Versions 401 and 403]

(no description)

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

Defines 1 class

Date:: (5 methods):
  fromYMD()
  getYear()
  getMonth()
  getDay()
  adjustYearMonth()


Class: Date  - X-Ref

fromYMD($year, $month, $day)   X-Ref
DATE.

The DATE function returns a value that represents a particular date.

NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.

Excel Function:
DATE(year,month,day)

PhpSpreadsheet is a lot more forgiving than MS Excel when passing non numeric values to this function.
A Month name or abbreviation (English only at this point) such as 'January' or 'Jan' will still be accepted,
as will a day value with a suffix (e.g. '21st' rather than simply 21); again only English language.

param: array|int $year The value of the year argument can include one to four digits.
param: array|int $month A positive or negative integer representing the month of the year
param: array|int $day A positive or negative integer representing the day of the month
return: mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,

getYear($year, int $baseYear)   X-Ref
Convert year from multiple formats to int.

param: mixed $year

getMonth($month)   X-Ref
Convert month from multiple formats to int.

param: mixed $month

getDay($day)   X-Ref
Convert day from multiple formats to int.

param: mixed $day

adjustYearMonth(int &$year, int &$month, int $baseYear)   X-Ref
No description