PHP Class WPSEO_Sitemap_Timezone, wordpress-seo

Datei anzeigen Open project: yoast/wordpress-seo Class Usage Examples

Public Methods

Method Description
format_date ( string $datetime_string, string $format = 'c' ) : string Format arbitrary UTC datetime string to desired form in site's time zone.
get_datetime_with_timezone ( string $datetime_string ) : DateTime | null Get the datetime object, in site's time zone, if the datetime string was valid

Private Methods

Method Description
determine_timezone_string ( ) : string Returns the timezone string for a site, even if it's set to a UTC offset
get_timezone_string ( ) : string Returns the correct timezone string

Method Details

format_date() public method

Format arbitrary UTC datetime string to desired form in site's time zone.
public format_date ( string $datetime_string, string $format = 'c' ) : string
$datetime_string string The input datetime string in UTC time zone.
$format string Date format to use.
return string

get_datetime_with_timezone() public method

Get the datetime object, in site's time zone, if the datetime string was valid
public get_datetime_with_timezone ( string $datetime_string ) : DateTime | null
$datetime_string string The datetime string in UTC time zone, that needs to be converted to a DateTime object.
return DateTime | null in site's time zone