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


PHP Zend_Date::subSecond方法代码示例

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


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

示例1: _decSec

 protected function _decSec($datetime)
 {
     $date = new Zend_Date($datetime, null, $this->_helper()->getLocale()->getLocaleCode());
     $date->subSecond(1);
     return $date->toString(self::MYSQL_ZEND_DATE_FORMAT);
 }
开发者ID:cnglobal-sl,项目名称:caterez,代码行数:6,代码来源:Aggregator.php

示例2: 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

示例3: addDaysFilter

 /**
  * Adds filter on days in wishlist
  *
  * $constraints may contain 'from' and 'to' indexes with number of days to look for items
  *
  * @param array $constraints
  * @return Mage_Wishlist_Model_Resource_Item_Collection
  */
 public function addDaysFilter($constraints)
 {
     if (!is_array($constraints)) {
         return $this;
     }
     $filter = array();
     $now = Mage::getSingleton('core/date')->date();
     $gmtOffset = (int) Mage::getSingleton('core/date')->getGmtOffset();
     if (isset($constraints['from'])) {
         $lastDay = new Zend_Date($now, Varien_Date::DATETIME_INTERNAL_FORMAT);
         $lastDay->subSecond($gmtOffset)->subDay($constraints['from'] - 1);
         $filter['to'] = $lastDay;
     }
     if (isset($constraints['to'])) {
         $firstDay = new Zend_Date($now, Varien_Date::DATETIME_INTERNAL_FORMAT);
         $firstDay->subSecond($gmtOffset)->subDay($constraints['to']);
         $filter['from'] = $firstDay;
     }
     if ($filter) {
         $filter['datetime'] = true;
         $this->addFieldToFilter('added_at', $filter);
     }
     return $this;
 }
开发者ID:blazeriaz,项目名称:youguess,代码行数:32,代码来源:Collection.php

示例4: subDays

 public function subDays($numDays)
 {
     $date = new \Zend_Date($this->_date, self::FORMAT);
     $this->_date = $date->subSecond(60 * 60 * 24 * (int) $numDays)->toString(self::FORMAT);
     return $this;
 }
开发者ID:philip-dakno,项目名称:basecamp,代码行数:6,代码来源:Date.php

示例5: gmtTimezoneFactory

 /**
  * Convert datetime to GMT timezonne
  *
  * @param string $datetime
  * @return string
  */
 public function gmtTimezoneFactory($datetime)
 {
     $newdate = $datetime;
     try {
         $dateObj = new Zend_Date($datetime, Zend_Date::ISO_8601);
         $dateObj->setTimezone('GMT');
         $newdate = $dateObj->subSecond($this->getTimeZoneOffset())->toString(self::MYSQL_ZEND_DATE_FORMAT);
     } catch (Exception $e) {
         Mage::logException($e->getMessage());
     }
     return $newdate;
 }
开发者ID:CherylMuniz,项目名称:fashion,代码行数:18,代码来源:Data.php

示例6: _calculateDateFromOffsetDays

 protected function _calculateDateFromOffsetDays(Date $referenceDate, $referenceDateOffset)
 {
     $referenceDate = new \Zend_Date((string) $referenceDate, Date::FORMAT);
     $referenceDateOffset = (int) $referenceDateOffset;
     if ($referenceDateOffset >= 0) {
         return $referenceDate->addSecond(60 * 60 * 24 * $referenceDateOffset)->toString(Date::FORMAT);
     }
     return $referenceDate->subSecond(60 * 60 * 24 * $referenceDateOffset * -1)->toString(Date::FORMAT);
 }
开发者ID:philip-dakno,项目名称:basecamp,代码行数:9,代码来源:Schema.php

示例7: registerIds

 /**
  * Add information about product ids to visitor/customer
  *
  * @param $object
  * @param $productIds
  */
 public function registerIds($object, $productIds)
 {
     $row = array('visitor_id' => $object->getVisitorId(), 'customer_id' => $object->getCustomerId(), 'store_id' => $object->getStoreId());
     $addedAt = new Zend_Date();
     $data = array();
     foreach ($productIds as $productId) {
         $productId = (int) $productId;
         if ($productId) {
             $row['product_id'] = $productId;
             $row['added_at'] = $addedAt->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
             $data[] = $row;
         }
         $addedAt->subSecond(1);
     }
     if (!empty($data)) {
         $this->_getWriteAdapter()->insertOnDuplicate($this->getMainTable(), $data, array_keys($row));
     }
     return $this;
 }
开发者ID:votanlean,项目名称:Magento-Pruebas,代码行数:25,代码来源:Abstract.php

示例8: decSec

 public function decSec($datetime)
 {
     $date = new Zend_Date($datetime, self::MYSQL_ZEND_DATE_FORMAT, $this->getLocale()->getLocaleCode());
     $date->subSecond(1);
     return $date->toString(self::MYSQL_ZEND_DATE_FORMAT);
 }
开发者ID:cnglobal-sl,项目名称:caterez,代码行数:6,代码来源:Date.php

示例9: testGetNextJob

 public function testGetNextJob()
 {
     $zendDate = new Zend_Date();
     $zendDate->subSecond(10);
     $this->jobData['next'] = $zendDate;
     unset($this->jobData['id']);
     $this->jobData['action'] = 'action_test';
     $job = new Enlight_Components_Cron_Job($this->jobData);
     $this->manager->addJob($job);
     $nextJob = $this->manager->getNextJob();
     $this->assertInstanceOf('Enlight_Components_Cron_Job', $nextJob);
 }
开发者ID:nvdnkpr,项目名称:Enlight,代码行数:12,代码来源:CronManagerTest.php

示例10: testGetNextCronJob

 public function testGetNextCronJob()
 {
     $zendDate = new Zend_Date();
     $zendDate->subSecond(10);
     $this->jobData['next'] = $zendDate;
     $job = new Enlight_Components_Cron_Job($this->jobData);
     $this->object->addJob($job);
     $nextJob = $this->object->getNextJob();
     $this->assertInstanceOf('Enlight_Components_Cron_Job', $nextJob);
 }
开发者ID:nvdnkpr,项目名称:Enlight,代码行数:10,代码来源:CronDbAdapterTest.php


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