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


PHP Zend_Date::getYear方法代码示例

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


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

示例1: testGetYear

 /**
  * Test for getYear
  */
 public function testGetYear()
 {
     $locale = new Zend_Locale('de_AT');
     $date = new Zend_Date(1234567890, $locale);
     $d2 = new Zend_Date(1610101010, $locale);
     $date->setTimeZone(date_default_timezone_get());
     $d2->setTimeZone(date_default_timezone_get());
     $result = $date->getYear();
     $this->assertTrue($result instanceof Zend_Date);
     $this->assertSame('01.01.2009 05:00:00', $result->toString());
     $this->assertSame('01.01.2021 05:00:00', $d2->getYear()->toString());
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:15,代码来源:DateTest.php

示例2: checkIfCcIsExpired

 public function checkIfCcIsExpired($expMonth, $expYear)
 {
     $today = new Zend_Date(Mage::app()->getLocale()->storeTimeStamp());
     $currentYear = (int) $today->getYear()->toString("YY");
     $currentMonth = (int) $today->getMonth()->toString("MM");
     if ($currentYear > (int) $expYear) {
         return false;
     }
     if ($currentYear == (int) $expYear && $currentMonth > (int) $expMonth) {
         return false;
     }
     return true;
 }
开发者ID:hipay,项目名称:hipay-fullservice-sdk-magento1,代码行数:13,代码来源:Data.php

示例3: getPaymentHistory

 /**
  * (non-PHPdoc)
  * @see Oara/Network/Oara_Network_Publisher_Base#getPaymentHistory()
  */
 public function getPaymentHistory()
 {
     $paymentHistory = array();
     $pointer = new Zend_Date("2010-01-01", "yyyy-MM-dd");
     $now = new Zend_Date();
     while ($now->getYear() >= $pointer->getYear()) {
         $valuesFormExport = array();
         $valuesFormExport[] = new Oara_Curl_Parameter('csv', 'csv');
         $valuesFormExport[] = new Oara_Curl_Parameter('ajax', 'ajax');
         $valuesFormExport[] = new Oara_Curl_Parameter('type', 'csv');
         $valuesFormExport[] = new Oara_Curl_Parameter('sortColumn', 'paymentid');
         $valuesFormExport[] = new Oara_Curl_Parameter('sortType', 'ASC');
         $valuesFormExport[] = new Oara_Curl_Parameter('startdate', $pointer->toString("yyyy") . "-01-01");
         $valuesFormExport[] = new Oara_Curl_Parameter('enddate', $pointer->toString("yyyy") . "-12-31");
         $valuesFormExport[] = new Oara_Curl_Parameter('payid_search', '');
         $urls = array();
         $urls[] = new Oara_Curl_Request('http://www.pepperjamnetwork.com/affiliate/report_payment_history.php?', $valuesFormExport);
         $exportReport = $this->_client->get($urls);
         $exportData = str_getcsv($exportReport[0], "\n");
         $num = count($exportData);
         for ($i = 1; $i < $num; $i++) {
             $paymentExportArray = str_getcsv($exportData[$i], ",");
             $obj = array();
             $obj['date'] = $paymentExportArray[5];
             $obj['pid'] = $paymentExportArray[0];
             if (preg_match('/[-+]?[0-9]*\\.?[0-9]+/', $paymentExportArray[4], $match)) {
                 $obj['value'] = (double) $match[0];
             }
             $obj['method'] = $paymentExportArray[2];
             $paymentHistory[] = $obj;
         }
         $pointer->addYear(1);
     }
     return $paymentHistory;
 }
开发者ID:garygarside,项目名称:php-oara,代码行数:39,代码来源:PepperJam.php

示例4: _getYearInterval

 /**
  * Get Interval for a year
  *
  * @param Zend_Date $dateStart
  * @param Zend_Date $dateEnd
  * @param bool $firstInterval
  * @return array
  */
 protected function _getYearInterval(Zend_Date $dateStart, Zend_Date $dateEnd, $firstInterval)
 {
     $interval = array();
     $interval['period'] = $dateStart->toString('yyyy');
     $interval['start'] = $firstInterval ? $dateStart->toString('yyyy-MM-dd 00:00:00') : $dateStart->toString('yyyy-01-01 00:00:00');
     $lastInterval = $dateStart->compareYear($dateEnd->getYear()) == 0;
     $interval['end'] = $lastInterval ? $dateStart->setMonth($dateEnd->getMonth())->setDay($dateEnd->getDay())->toString('yyyy-MM-dd 23:59:59') : $dateStart->toString('yyyy-12-31 23:59:59');
     $dateStart->addYear(1);
     if ($dateStart->compareYear($dateEnd->getYear()) == 0) {
         $dateStart->setMonth(1)->setDay(1);
     }
     return $interval;
 }
开发者ID:natxetee,项目名称:magento2,代码行数:21,代码来源:Collection.php

示例5: getCards

 public function getCards()
 {
     if (is_null($this->_cards)) {
         $today = new Zend_Date(Mage::app()->getLocale()->storeTimeStamp());
         $currentYear = (int) $today->getYear()->toString("YY");
         $currentMonth = (int) $today->getMonth()->toString("MM");
         $this->_cards = Mage::getResourceModel('hipay/card_collection')->addFieldToSelect('*')->addFieldToFilter('customer_id', $this->getCustomer()->getId())->addFieldToFilter('cc_status', Allopass_Hipay_Model_Card::STATUS_ENABLED)->addFieldToFilter('cc_exp_year', array("gteq" => $currentYear))->setOrder('card_id', 'desc')->setOrder('is_default', 'desc');
         foreach ($this->_cards as $card) {
             if ($card->ccExpYear == $currentYear && $currentMonth < $card->ccExpMonth) {
                 $this->_cards->removeItemByKey($card->getId());
             }
         }
     }
     return $this->_cards;
 }
开发者ID:hipay,项目名称:hipay-fullservice-sdk-magento1,代码行数:15,代码来源:Abstract.php


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