I'm developing a widget in Wordpress to import sport scores through a RSS feed. The RSS feed items have a which is the match date and time, so it's really important information. The item in the RSS feed look likes this: [ Sat, 14 Nov 2015 15:00:00 +0100 ], but when I want to get this date in a variable with:
$date = $item->get_date();
I'm getting the following output: 14 November 2015, 2:00 pm
The right time should be 15:00 (local). Does anybody know how I can get the right time from the RSS feed?
$rss = fetch_feed('http://www.volleybal.nl/application/handlers/export.php?format=rss&type=vereniging&programma=7141&iRegionId=7000');
if (!is_wp_error($rss)) : // Checks that the object is created correctly
// Figure out how many total items there are, but limit it to 5.
$maxitems = $rss->get_item_quantity();
// Build an array of all the items, starting with element 0 (first element).
$rss_items = $rss->get_items(0, $maxitems);
endif;
foreach ($rss_items as $item) :
$splitby = array('Wedstrijd:', 'Datum:', 'Speellocatie:');
$text = esc_html($item->get_description());
$split = explode(' ', $text);
$result = array();
$temp = array();
$date = strtotime($item->get_date());
$day = date('j M', $date);
$time = date('G:i', $date);
endforeach;