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


PHP Zend_Date::addMinute方法代码示例

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


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

示例1: _getDate

 protected function _getDate($timeAmount, Zend_Date $date)
 {
     $nowDate = new Zend_Date();
     $dateWithTimeAmount = $date->addHour($timeAmount);
     if ($timeAmount == 0) {
         $date = $date->addMinute(1);
     } elseif ($timeAmount < 0 && $nowDate->isLater($dateWithTimeAmount)) {
         $date = $nowDate->addMinute(1);
     } else {
         $date = $dateWithTimeAmount;
     }
     return $date;
 }
开发者ID:xiaoguizhidao,项目名称:mydigibits,代码行数:13,代码来源:Alert.php

示例2: getSumGroupSelect

 /**
  * 取得InfoServer数据表中某个时间段的分组数据SQL语句
  * 
  * @param integer $startTimestamp
  * @param integer $range
  * @param array|string $spec
  * @return Zend_Db_Select
  */
 public function getSumGroupSelect($startTimestamp = null, $range = null, $spec = 'rTimestamp')
 {
     $select = $this->select(true)->reset(self::COLUMNS)->columns(array('rTimestamp', 'OnlineNum' => $this->_exprSumOnlineNum));
     if (!empty($startTimestamp)) {
         $startDate = new Zend_Date($startTimestamp);
         $select->where('rTimestamp >= ?', $startDate->setSecond(0)->getTimestamp(), Zend_DB::INT_TYPE);
         if (!empty($range)) {
             $select->where('rTimestamp <= ?', $startDate->addMinute($range - 1)->setSecond(59)->getTimestamp(), Zend_DB::INT_TYPE);
         }
     }
     $select->group($spec);
     return $select;
 }
开发者ID:starflash,项目名称:ZtChart-ZF1-Example,代码行数:21,代码来源:Infoserver.php

示例3: testLoose


//.........这里部分代码省略.........
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->setHour(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->addHour(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->subHour(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->compareHour(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->setMinute(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->addMinute(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->subMinute(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->compareMinute(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->setSecond(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->addSecond(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->subSecond(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->compareSecond(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->setWeek(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->addWeek(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->subWeek(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->compareWeek(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:101,代码来源:DateTest.php

示例4: setHorarios

 /**
  * 
  * @param type $horarios
  * @param type $intervalo
  */
 private function setHorarios($salao_id, $dia_semana, $horario_fechamento, $horario_abertura)
 {
     $horarios = ($horario_fechamento - $horario_abertura) * 2;
     $date = date('Y-m-d') . ' ' . $horario_abertura;
     $zendDate = new Zend_Date($date);
     $horario = $zendDate->subMinute(30);
     for ($i = 0; $i <= $horarios; $i++) {
         $horario = $zendDate->addMinute(30)->get(Zend_Date::TIME_SHORT);
         $insertHorario = array('salao_id' => $salao_id, 'salao_horario_dia_semana' => $dia_semana, 'salao_horario' => $horario);
         $modelSalaoHorario = new Model_DbTable_SalaoHorario();
         if (!$modelSalaoHorario->insert($insertHorario)) {
             throw new Exception("Falha ao cadastrar os horários");
         }
     }
 }
开发者ID:nandorodpires2,项目名称:homemakes,代码行数:20,代码来源:FuncionamentoController.php

示例5: readAction

 public function readAction()
 {
     $this->disableLayout();
     $this->disableView();
     $ressource_dir = dirname(dirname(__FILE__)) . '/ressources';
     /* var_dump($this->_request);
        exit;*/
     $feed = $this->_request->getParam('feed');
     $catID = $this->_request->getParam('catID');
     $feed = str_replace('.xml', "-{$catID}.xml", $feed);
     $rssLimit = Cible_FunctionsCategories::getRssItemsLimitPerCategory($catID);
     $langId = Cible_FunctionsGeneral::getLanguageID($this->_request->getParam('lang'));
     Zend_Registry::set('languageID', $langId);
     $lang = $this->_request->getParam('lang');
     $feed_url = Zend_Registry::get('absolute_web_root') . "/{$this->_request->getParam('lang')}/{$this->_request->getParam('feed')}";
     if (file_exists("{$ressource_dir}/{$lang}/{$feed}")) {
         $lastUpdate = new Zend_Date(filemtime("{$ressource_dir}/{$lang}/{$feed}"));
         $now = new Zend_Date();
     }
     if (file_exists("{$ressource_dir}/{$lang}/{$feed}") && !$now->isLater($lastUpdate->addMinute($this->_config->rss->refresh->delay))) {
         $xml = file_get_contents("{$ressource_dir}/{$lang}/{$feed}");
     } else {
         $file = fopen("{$ressource_dir}/{$lang}/{$feed}", "w");
         $select = $this->_db->select();
         $select->from('NewsData')->joinLeft('NewsIndex', 'NewsData.ND_ID = NewsIndex.NI_NewsDataID')->joinleft('CategoriesIndex', 'CategoriesIndex.CI_CategoryID = NewsData.ND_CategoryID')->joinleft('Categories', 'Categories.C_ID = NewsData.ND_CategoryID')->where('CategoriesIndex.CI_LanguageID = ?', $langId)->where('NewsIndex.NI_LanguageID = ?', $langId)->where('Categories.C_ID = ?', $catID)->where('Categories.C_ShowInRss = ?', 1)->order('ND_Date DESC')->limit($rssLimit);
         //die($select);
         $news = $this->_db->fetchAll($select);
         $feedPubDate = date("r", strtotime('now'));
         $xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
         $xml .= "<rss version=\"2.0\">";
         $xml .= "<channel>";
         $xml .= "<title>" . $this->_config->site->title . "</title>";
         $xml .= "<description>";
         $xml .= str_replace('##SITE_NAME##', $this->_config->site->title, $this->view->getCibleText('rss_read_description_field_label'));
         $xml .= "</description>";
         $xml .= "<lastBuildDate>{$feedPubDate}</lastBuildDate>";
         $xml .= "<link>{$feed_url}</link>";
         foreach ($news as $details) {
             if ($details['NI_Status'] == 1) {
                 // Titres des nouvelles (FR)
                 $title = str_replace("'", "'", $details['NI_Title']);
                 $title = str_replace("<br>", "<br />", $title);
                 $title = str_replace("&", "&amp;", $title);
                 // Textes des nouvelles (FR)
                 $description = str_replace("'", "'", $this->KeepTextOnly($details["NI_Brief"]));
                 $description = htmlspecialchars($description);
                 $description = str_replace("<br>", "<br />", $description);
                 $pubDate = date("r", strtotime($details["ND_ReleaseDate"]));
                 $news_url = Zend_Registry::get('absolute_web_root') . '/' . Cible_FunctionsCategories::getPagePerCategoryView($details["ND_CategoryID"], 'details') . "/ID/{$details['ND_ID']}";
                 $xml .= "<item>";
                 $xml .= "<title>{$title}</title>";
                 $xml .= "<description>{$description}</description>";
                 $xml .= "<pubDate>{$pubDate}</pubDate>";
                 $xml .= "<guid>{$news_url}</guid>";
                 $xml .= "<link>{$news_url}</link>";
                 $xml .= "</item>";
             }
         }
         $xml .= "</channel>";
         $xml .= "</rss>";
         fwrite($file, $xml);
         fclose($file);
     }
     $this->_response->setHeader('Content-Type', 'application/rss+xml');
     echo $xml;
 }
开发者ID:anunay,项目名称:stentors,代码行数:66,代码来源:IndexController.php


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