当前位置: 首页>>代码示例>>PHP>>正文


PHP SimplePie_Misc::parse_date方法代码示例

本文整理汇总了PHP中SimplePie_Misc::parse_date方法的典型用法代码示例。如果您正苦于以下问题:PHP SimplePie_Misc::parse_date方法的具体用法?PHP SimplePie_Misc::parse_date怎么用?PHP SimplePie_Misc::parse_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimplePie_Misc的用法示例。


在下文中一共展示了SimplePie_Misc::parse_date方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test

 function test()
 {
     $this->result = SimplePie_Misc::parse_date($this->data);
 }
开发者ID:patrickmj,项目名称:FeedImporter,代码行数:4,代码来源:functions.php

示例2: define

 * @license http://www.opensource.org/licenses/bsd-license.php BSD License
 * @todo phpDoc comments
 */
/**
 * SimplePie Name
 */
define('SIMPLEPIE_NAME', 'SimplePie');
/**
 * SimplePie Version
 */
define('SIMPLEPIE_VERSION', '1.3-dev');
/**
 * SimplePie Build
 * @todo Hardcode for release (there's no need to have to call SimplePie_Misc::parse_date() only every load of simplepie.inc)
 */
define('SIMPLEPIE_BUILD', gmdate('YmdHis', SimplePie_Misc::parse_date(substr('$Date$', 7, 25)) ? SimplePie_Misc::parse_date(substr('$Date$', 7, 25)) : filemtime(__FILE__)));
/**
 * SimplePie Website URL
 */
define('SIMPLEPIE_URL', 'http://simplepie.org');
/**
 * SimplePie Useragent
 * @see SimplePie::set_useragent()
 */
define('SIMPLEPIE_USERAGENT', SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION . ' (Feed Parser; ' . SIMPLEPIE_URL . '; Allow like Gecko) Build/' . SIMPLEPIE_BUILD);
/**
 * SimplePie Linkback
 */
define('SIMPLEPIE_LINKBACK', '<a href="' . SIMPLEPIE_URL . '" title="' . SIMPLEPIE_NAME . ' ' . SIMPLEPIE_VERSION . '">' . SIMPLEPIE_NAME . '</a>');
/**
 * No Autodiscovery
开发者ID:karlstolley,项目名称:twitter-workshop-cw2010,代码行数:31,代码来源:simplepie.class.php

示例3: _load_events

 /**
  * Load Events
  *
  * Load Google Calendar events from SimplePie object
  *
  * @access	public
  * @param	SimplePie object
  * @return	void
  */
 function _load_events($feed)
 {
     foreach ($feed->get_items() as $event) {
         // grab Google-namespaced tags (<gd:when>, <gd:where>, etc.)
         $when = $event->get_item_tags('http://schemas.google.com/g/2005', 'when');
         $where = $event->get_item_tags('http://schemas.google.com/g/2005', 'where');
         $location = $where[0]['attribs']['']['valueString'];
         $startTime = $when[0]['attribs']['']['startTime'];
         $startTime = SimplePie_Misc::parse_date($startTime);
         $endTime = $when[0]['attribs']['']['endTime'];
         $endTime = SimplePie_Misc::parse_date($endTime);
         // provide event only if there's actually a title here (private events don't have titles)
         if (strlen(trim($event->get_title())) > 1) {
             $this->events[] = array('title' => $event->get_title(), 'description' => $event->get_description(), 'link' => $event->get_link(), 'start_time' => $startTime, 'end_time' => $endTime, 'location' => $location);
         }
     }
 }
开发者ID:hamiltonmascioli,项目名称:EE2-Google-Calendar-,代码行数:26,代码来源:pi.gcal.php

示例4: get_date

 function get_date($date_format = 'j F Y, g:i a')
 {
     if (!isset($this->data['date'])) {
         if ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'published')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'updated')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'issued')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'created')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'modified')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags('', 'pubDate')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'date')) {
             $this->data['date']['raw'] = $return[0]['data'];
         } elseif ($return = $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'date')) {
             $this->data['date']['raw'] = $return[0]['data'];
         }
         if (!empty($this->data['date']['raw'])) {
             $this->data['date']['parsed'] = SimplePie_Misc::parse_date($this->data['date']['raw']);
         } else {
             $this->data['date'] = null;
         }
     }
     if ($this->data['date']) {
         $date_format = (string) $date_format;
         switch ($date_format) {
             case '':
                 return $this->sanitize($this->data['date']['raw'], SIMPLEPIE_CONSTRUCT_TEXT);
             case 'U':
                 return $this->data['date']['parsed'];
             default:
                 return date($date_format, $this->data['date']['parsed']);
         }
     } else {
         return null;
     }
 }
开发者ID:pyfun,项目名称:dokuwiki,代码行数:40,代码来源:SimplePie.php

示例5: strtolower

     $author = strtolower($dynamicMeta[$cType_value . '_author']);
 }
 for ($count = 0, $index = 0; $index < $feedItems; $index++) {
     // Exp 1) Start $count and $index at 0; Exp 2) If $index is less than the total number of feed items, continue; Exp 3) Increment $index at the end of each iteration
     $item = $feed->get_item($index);
     // Get each feed item starting with the first,
     if ($count < $limit) {
         // and continue as long as the number of items to display is less than the limit (or until Exp 2 in the For loop returns false). Here instead of the For loop because the result is only taken from the last part of Exp 2
         // Individual event (feed item) author
         $postAuthor = strtolower($item->get_author()->get_name());
         // Individual event time info
         $when = $item->get_item_tags('http://schemas.google.com/g/2005', 'when');
         // Get the Google-namespaced <gd:when> tag
         $date = $when[0]['attribs']['']['startTime'];
         // Get the startTime attribute
         $sortDate = SimplePie_Misc::parse_date($date);
         // Convert to UNIX timestamp - this will be used for sorting
         $displayDate = date('M d, g:i a', $sortDate);
         // A more readable date for displaying
         // Individual location info
         $where = $item->get_item_tags('http://schemas.google.com/g/2005', 'where');
         // Get the Google-namespaced <gd:where> tag
         $venueName = $where[0]['attribs']['']['valueString'];
         // Get the valueString attribute (the venue name)
         $venueLink = $where[0]['child']['http://schemas.google.com/g/2005']['entryLink'][0]['attribs']['']['href'];
         // Get the entryLink href value (the venue link)
         $venueAddress = $where[0]['child']['http://schemas.google.com/g/2005']['entryLink'][0]['child']['http://schemas.google.com/g/2005']['entry'][0]['child']['http://schemas.google.com/g/2005']['postalAddress'][0]['data'];
         // Get the... event address
         // Individual event cost info
         $extendedProperty = $item->get_item_tags('http://schemas.google.com/g/2005', 'extendedProperty');
         // Get the Google-namespaced <gd:extendedProperty> tag
开发者ID:washingtonstateuniversity,项目名称:CAHNRSWP-Theme-Web-Integration-Project,代码行数:31,代码来源:dynamic_display.php


注:本文中的SimplePie_Misc::parse_date方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。