SimplePie 1.5 is now available!

SimplePie Documentation.  Learn how to use this thing.  It's way better than going to school.

You are here: Documentation » API Reference » SimplePie_Item » get_local_date()

get_local_date()

Description

class SimplePie_Item {
	get_local_date ( [$date_format = '%c'] )
}

Returns the date/timestamp of the posting in the localized language. Date format supports anything that works with PHP's strftime() function. To display in other languages, you need to change the locale with PHP's setlocale() function. The available localizations depend on which ones are installed on your web server.

Availability

  • Available since SimplePie 1.0.

Parameters

date_format

Accepts any value allowed by strftime().

Examples

Display the date

// Set the region/language to Canadian French
setlocale(LC_TIME, 'fr_CA');
 
$feed = new SimplePie();
$feed->set_feed_url('http://simplepie.org/blog/feed/');
$feed->init();
$feed->handle_content_type();
 
foreach ($feed->get_items() as $item)
{
	echo $item->get_local_date('%A %e %B %Y');
}

See Also


reference/simplepie_item/get_local_date.txt · Last modified: 2011/03/06 03:56 (external edit)