Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
Date Class Reference

Date Parser. More...

Public Member Functions

 __construct ()
 Create new Date object, and set self\day_pcre, self\month_pcre, and self\built_in.
 
 add_callback ($callback)
 Add a callback method to parse a date.
 
 date_asctime ($date)
 Parse C99's asctime()'s date format.
 
 date_rfc2822 ($date)
 Parse RFC2822's date format.
 
 date_rfc850 ($date)
 Parse RFC850's date format.
 
 date_strtotime ($date)
 Parse dates using strtotime()
 
 date_w3cdtf ($date)
 Parse a superset of W3C-DTF (allows hyphens and colons to be omitted, as well as allowing any of upper or lower case "T", horizontal tabs, or spaces to be used as the time separator (including more than one))
 
 parse ($date)
 Parse a date.
 
 remove_rfc2822_comments ($string)
 Remove RFC822 comments.
 

Static Public Member Functions

static get ()
 Get the object.
 

Public Attributes

array $built_in = []
 Array of user-added callback methods.
 
string $date
 Input data.
 
array $day
 List of days, calendar day name => ordinal day number in the week.
 
string $day_pcre
 Cached PCRE for Date\$day.
 
array $month
 List of months, calendar month name => calendar month number.
 
string $month_pcre
 Cached PCRE for Date\$month.
 
array $timezone
 List of timezones, abbreviation => offset from UTC.
 
array $user = []
 Array of user-added callback methods.
 

Detailed Description

Date Parser.

@subpackage Parsing

Member Function Documentation

◆ add_callback()

Date::add_callback ( $callback)

Add a callback method to parse a date.

@final

Parameters
callable$callback

◆ date_asctime()

Date::date_asctime ( $date)

Parse C99's asctime()'s date format.

Return values
intTimestamp

◆ date_rfc2822()

Date::date_rfc2822 ( $date)

Parse RFC2822's date format.

Return values
intTimestamp

◆ date_rfc850()

Date::date_rfc850 ( $date)

Parse RFC850's date format.

Return values
intTimestamp

◆ date_strtotime()

Date::date_strtotime ( $date)

Parse dates using strtotime()

Return values
intTimestamp

◆ date_w3cdtf()

Date::date_w3cdtf ( $date)

Parse a superset of W3C-DTF (allows hyphens and colons to be omitted, as well as allowing any of upper or lower case "T", horizontal tabs, or spaces to be used as the time separator (including more than one))

Return values
intTimestamp

◆ parse()

Date::parse ( $date)

Parse a date.

@final

Parameters
string$dateDate to parse
Return values
intTimestamp corresponding to date string, or false on failure

◆ remove_rfc2822_comments()

Date::remove_rfc2822_comments ( $string)

Remove RFC822 comments.

Parameters
string$dataData to strip comments from
Return values
stringComment stripped string

The documentation for this class was generated from the following file: