Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

(no description)

File Size: 168 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.

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

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