PHP Класс FeedTime, feedwordpress

We will try to be as tolerant as possible of different representations, since RSS Is A Fucking Mess, broken dates seem to be especially pervasive, etc. Supports anything that your version of PHP's strtotime() can handle; also has a built-in parser for W3C DTF, in case your PHP doesn't have that. Tries to parse a W3C DTF first; then falls back to strtotime(). If strtotime fails due to a mystery timezone, then we will try again on local time, with the timezone stripped out. To parse a string representation of a date-time from a feed, instantiate and then pull the timestamp: $time = new FeedTime($s); if (!$time->failed()) : $ts = $time->timestamp(); else : ... endif;
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$rep
$ts

Открытые методы

Метод Описание
FeedTime ( $time ) * FeedTime constructor
__construct ( $time )
failed ( ) * FeedTime::timestamp()
parse_w3cdtf ( ) FeedTime::parse_w3cdtf() parses a W3C date-time format date into a Unix epoch timestamp. Derived from the parse_w3cdtf function included with MagpieRSS by Kellan Elliot-McCrea , with modifications and bugfixes by Charles Johnson , under the terms of the GPL.
set ( $time, $recurse = false )
timestamp ( ) * FeedTime::set()

Описание методов

FeedTime() публичный Метод

* FeedTime constructor
public FeedTime ( $time )

__construct() публичный Метод

public __construct ( $time )

failed() публичный Метод

* FeedTime::timestamp()
public failed ( )

parse_w3cdtf() публичный Метод

FeedTime::parse_w3cdtf() parses a W3C date-time format date into a Unix epoch timestamp. Derived from the parse_w3cdtf function included with MagpieRSS by Kellan Elliot-McCrea , with modifications and bugfixes by Charles Johnson , under the terms of the GPL.
public parse_w3cdtf ( )

set() публичный Метод

public set ( $time, $recurse = false )

timestamp() публичный Метод

* FeedTime::set()
public timestamp ( )

Описание свойств

$rep публичное свойство

public $rep

$ts публичное свойство

public $ts