Skip to content

Date

Date Parser

  • Full name: \SimplePie\Parse\Date

Properties

date

Input data

public string $date

day

List of days, calendar day name => ordinal day number in the week

public array $day

month

List of months, calendar month name => calendar month number

public array $month

timezone

List of timezones, abbreviation => offset from UTC

public array $timezone

day_pcre

Cached PCRE for Date::$day

public string $day_pcre

month_pcre

Cached PCRE for Date::$month

public string $month_pcre

built_in

Array of user-added callback methods

public array $built_in

user

Array of user-added callback methods

public array $user

Methods

__construct

Create new Date object, and set self::day_pcre, self::month_pcre, and self::built_in

public __construct(): mixed

get

Get the object

public static get(): mixed
  • This method is static.

parse

Parse a date

public parse(string $date): int

Parameters:

Parameter Type Description
$date string Date to parse

Return Value:

Timestamp corresponding to date string, or false on failure


add_callback

Add a callback method to parse a date

public add_callback(callable $callback): mixed

Parameters:

Parameter Type Description
$callback callable

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))

public date_w3cdtf(mixed $date): int

Parameters:

Parameter Type Description
$date mixed

Return Value:

Timestamp


remove_rfc2822_comments

Remove RFC822 comments

public remove_rfc2822_comments(mixed $string): string

Parameters:

Parameter Type Description
$string mixed

Return Value:

Comment stripped string


date_rfc2822

Parse RFC2822's date format

public date_rfc2822(mixed $date): int

Parameters:

Parameter Type Description
$date mixed

Return Value:

Timestamp


date_rfc850

Parse RFC850's date format

public date_rfc850(mixed $date): int

Parameters:

Parameter Type Description
$date mixed

Return Value:

Timestamp


date_asctime

Parse C99's asctime()'s date format

public date_asctime(mixed $date): int

Parameters:

Parameter Type Description
$date mixed

Return Value:

Timestamp


date_strtotime

Parse dates using strtotime()

public date_strtotime(mixed $date): int

Parameters:

Parameter Type Description
$date mixed

Return Value:

Timestamp



Automatically generated on 2025-03-18