當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。