SimplePie_Item::get_updated_date

Advertisement

Summery Summery

Get the update date/time for the item

Syntax Syntax

SimplePie_Item::get_updated_date( string $date_format = 'j F Y, g:i a' )

Description Description

Uses <atom:updated>

Note: obeys PHP’s timezone setting. To get a UTC date/time, use get_gmdate

Parameters Parameters

$date_format

(Optional) Supports any PHP date format from http://php.net/date (empty for the raw data)

Default value: 'j F Y, g:i a'

Return Return

(int|string|null)

Source Source

File: wp-includes/SimplePie/Item.php

	/**
	 * Get the update date/time for the item
	 *
	 * Uses `<atom:updated>`
	 *
	 * Note: obeys PHP's timezone setting. To get a UTC date/time, use
	 * {@see get_gmdate}
	 *
	 * @param string $date_format Supports any PHP date format from {@see http://php.net/date} (empty for the raw data)
	 * @return int|string|null
	 */
	public function get_updated_date($date_format = 'j F Y, g:i a')
	{
		if (!isset($this->data['updated']))
		{
			if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated'))
			{
				$this->data['updated']['raw'] = $return[0]['data'];
			}

			if (!empty($this->data['updated']['raw']))
			{
				$parser = $this->registry->call('Parse_Date', 'get');
				$this->data['updated']['parsed'] = $parser->parse($this->data['updated']['raw']);
			}
			else
			{
				$this->data['updated'] = null;
			}
		}
		if ($this->data['updated'])
		{
			$date_format = (string) $date_format;
			switch ($date_format)
			{
				case '':
					return $this->sanitize($this->data['updated']['raw'], SIMPLEPIE_CONSTRUCT_TEXT);

				case 'U':

Advertisement

Advertisement

Leave a Reply