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


PHP JDate::createFromFormat方法代码示例

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


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

示例1: calendar

 function calendar()
 {
     $date = JDate::createFromFormat('Y', $_POST['year']);
     $min_date = clone $date;
     $min_date = $min_date->modify('-1 year');
     $max_date = $date->modify('+1 year');
     $calendar_attributes = array('min_select_year' => $min_date->format('Y'), 'max_select_year' => $max_date->format('Y'));
     if (isset($_REQUEST['action']) and $_REQUEST['action'] == 'pn_get_month_cal') {
         require_once JPATH_COMPONENT_ADMINISTRATOR . '/classes/calendar.php';
         AImporter::css('calendar');
         $calendar = new PN_Calendar($calendar_attributes);
         echo $calendar->draw(array(), $_REQUEST['year'], $_REQUEST['month']);
         exit;
     }
 }
开发者ID:hixbotay,项目名称:executivetransport,代码行数:15,代码来源:tour.php

示例2: calendar

 function calendar()
 {
     $date = JDate::createFromFormat('Y', $_POST['year']);
     $min_date = clone $date;
     $min_date = $min_date->modify('-1 year');
     $max_date = $date->modify('+1 year');
     $calendar_attributes = array('min_select_year' => $min_date->format('Y'), 'max_select_year' => $max_date->format('Y'));
     if (isset($_REQUEST['action']) and $_REQUEST['action'] == 'pn_get_month_cal') {
         AImporter::classes('dayoffcalendar');
         AImporter::css('calendar');
         $calendar = new PN_Calendar($calendar_attributes);
         echo $calendar->draw(array(), $_REQUEST['year'], $_REQUEST['month']);
         exit;
     }
 }
开发者ID:hixbotay,项目名称:executivetransport,代码行数:15,代码来源:transportdayoff.php

示例3: index

 protected function index()
 {
     $indexingParams = array();
     if ($this->input->getString('u') || $this->input->getString('update')) {
         $lastModified = $this->input->getString('u', $this->input->getString('update'));
         $d = JDate::createFromFormat("Y-m-d\\TH:i:sP", $lastModified, new DateTimeZone(JFactory::getConfig()->get('offset')));
         $valid = false;
         if ($d) {
             if ($d->getTimezone()) {
                 $format = "Y-m-d\\TH:i:s" . ($d->getTimezone()->getName() == 'Z' ? '\\Z' : 'P');
                 if ($d->format($format) == $lastModified) {
                     $valid = true;
                 }
             }
         }
         if ($valid) {
             $indexingParams['lastModified'] = $lastModified;
         } else {
             $client = \JSolr\Index\Factory::getService();
             if ($client->ping()) {
                 $response = $client->luke();
                 $indexingParams['lastModified'] = $response->index->lastModified;
             }
         }
     }
     $start = new JDate('now');
     $this->out("crawl start " . $start->format("c"));
     $this->_fireEvent('onIndex', array(get_class($this), $this->_isVerbose(), $indexingParams), $this->_getPlugin());
     $end = new JDate('now');
     $this->out("crawl end " . $end->format("c"));
     $time = $start->diff($end);
     $this->out("execution time: " . $time->format("%H:%I:%S"));
 }
开发者ID:bellodox,项目名称:jsolr,代码行数:33,代码来源:jsolr_crawler.php


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