Date
- Source
wp-includes/SimplePie/src/Parse/Date.php:13
Date Parser
Compatibility
- WordPress
- core
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Properties · 8
$datestringpublic- Input data
$daySimplePie\Parse\array<string,public- List of days, calendar day name => ordinal day number in the week
$monthSimplePie\Parse\array<string,public- List of months, calendar month name => calendar month number
$timezoneSimplePie\Parse\array<string,public- List of timezones, abbreviation => offset from UTC
$day_pcrestringpublic- Cached PCRE for Date::$day
$month_pcrestringpublic- Cached PCRE for Date::$month
$built_inSimplePie\Parse\array<string>public- Array of user-added callback methods
$userSimplePie\Parse\array<callable(string):public- Array of user-added callback methods
Methods · 10
- __construct()Create new Date object, and set self::day_pcre, self::month_pcre, and self::built_in
- get()Get the object
- parse()Parse a date
- add_callback()Add a callback method to parse a date
- date_w3cdtf()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))
- remove_rfc2822_comments()Remove RFC822 comments
- date_rfc2822()Parse RFC2822's date format
- date_rfc850()Parse RFC850's date format
- date_asctime()Parse C99's asctime()'s date format
- date_strtotime()Parse dates using strtotime()
Source code
class Date{ /** * Input data * * @access protected * @var string */ public $date; /** * List of days, calendar day name => ordinal day number in the week * * @access protected * @var array<string, int<1,7>> */ public $day = [ // English 'mon' => 1, 'monday' => 1, 'tue' => 2, 'tuesday' => 2, 'wed' => 3, 'wednesday' => 3, 'thu' => 4, 'thursday' => 4, 'fri' => 5, 'friday' => 5, 'sat' => 6, 'saturday' => 6, 'sun' => 7, 'sunday' => 7, // Dutch 'maandag' => 1, 'dinsdag' => 2, 'woensdag' => 3, 'donderdag' => 4, 'vrijdag' => 5, 'zaterdag' => 6, 'zondag' => 7, // French 'lundi' => 1, 'mardi' => 2, 'mercredi' => 3, 'jeudi' => 4, 'vendredi' => 5, 'samedi' => 6, 'dimanche' => 7, // German 'montag' => 1, 'mo' => 1, 'dienstag' => 2, 'di' => 2, 'mittwoch' => 3, 'mi' => 3, 'donnerstag' => 4, 'do' => 4, 'freitag' => 5, 'fr' => 5, 'samstag' => 6, 'sa' => 6, 'sonnabend' => 6, // AFAIK no short form for sonnabend 'so' => 7, 'sonntag' => 7, // Italian 'lunedì' => 1, 'martedì' => 2, 'mercoledì' => 3, 'giovedì' => 4, 'venerdì' => 5, 'sabato' => 6, 'domenica' => 7, // Spanish 'lunes' => 1, 'martes' => 2, 'miércoles' => 3, 'jueves' => 4, 'viernes' => 5, 'sábado' => 6,Changelog
Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/SimplePie/src/Parse/Date.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.