當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Date::compareTimestamp方法代碼示例

本文整理匯總了PHP中Zend_Date::compareTimestamp方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Date::compareTimestamp方法的具體用法?PHP Zend_Date::compareTimestamp怎麽用?PHP Zend_Date::compareTimestamp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Date的用法示例。


在下文中一共展示了Zend_Date::compareTimestamp方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getNumFree

 /**
  * 
  * Checks if invites exists or can be created
  */
 public function getNumFree()
 {
     $auth = Zend_Auth::getInstance();
     $signedUserInfo = self::$_registry->get("signedUserInfo");
     $membershipdate = new Zend_Date($signedUserInfo['membershipdate'], Zend_Date::ISO_8601);
     if ($membershipdate->compareTimestamp(time() - self::NEW_USER * 86400) == 1) {
         return -1;
     }
     $date = new Zend_Date();
     $select = $this->_dbTable->select()->where("uid = ?", $auth->getIdentity())->where("used = ?", "1")->where("timestamp > DATE_ADD(?, INTERVAL -" . self::MAX_DAYS . " DAY)", $date->get("yyyy-MM-dd HH:mm:ss"));
     $used = $this->_dbAdapter->fetchAll($select);
     $usedNum = sizeof($used);
     return self::MAX_INVITES - $usedNum;
 }
開發者ID:henvic,項目名稱:MediaLab,代碼行數:18,代碼來源:Invites.php

示例2: testCompareTimestamp

 /**
  * Test for compareTimestamp
  */
 public function testCompareTimestamp()
 {
     $locale = new Zend_Locale('de_AT');
     $date1 = new Zend_Date(0, null, $locale);
     $date2 = new Zend_Date(0, null, $locale);
     $this->assertSame(0, $date1->compareTimestamp($date2));
     $date2 = new Zend_Date(100, null, $locale);
     $this->assertSame(-1, $date1->compareTimestamp($date2));
     $date2 = new Zend_Date(-100, null, $locale);
     $this->assertSame(1, $date1->compareTimestamp($date2));
 }
開發者ID:jsnshrmn,項目名稱:Suma,代碼行數:14,代碼來源:DateTest.php

示例3: testCompareTimestamp2

 /**
  * Test for compareTimestamp
  */
 public function testCompareTimestamp2()
 {
     $locale = new Zend_Locale('de_AT');
     $date1 = new Zend_Date(0, false, $locale);
     $date2 = new Zend_Date(100, false, $locale);
     $this->assertSame($date1->compareTimestamp($date2), '-100');
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:10,代碼來源:DateTest.php

示例4: sendNewsletterAction

 public function sendNewsletterAction()
 {
     $releaseID = $this->_getParam('newsletterID');
     $this->view->assign('releaseID', $releaseID);
     if ($this->_request->isPost()) {
         $this->_redirect("/newsletter/index/edit/newsletterID/{$releaseID}");
     } elseif (empty($releaseID)) {
         /*
          * The following part of code is to send data with CRON task.
          * Code not finished. To be implemented in further version.
          */
         $this->disableView();
         //            $releaseId  = $this->_getParam('newsletterID');
         $oNewsRelease = new NewsletterReleases();
         $primary = $oNewsRelease->info('primary');
         $select = $oNewsRelease->select()->from($oNewsRelease->info('name'));
         $nrData = $oNewsRelease->fetchAll($select)->toArray();
         $listSent = array();
         $listDest = array();
         $listIds = array();
         foreach ($nrData as $release) {
             $scheduled = $release['NR_MailingDateTimeScheduled'];
             $oDate = new Zend_Date($scheduled, 'fr');
             $now = Zend_Date::now('fr')->getTimestamp();
             $timeToSend = $oDate->compareTimestamp($now);
             if ($timeToSend < 1 && (int) $release['NR_Status'] != 1 && $oDate->get() > 0) {
                 $massMailingResults = $this->sendMassMailingAction($release['NR_ID']);
                 array_push($listSent, $release['NR_Title']);
                 array_push($listIds, $release['NR_ID']);
                 array_push($listDest, $release['NR_AdminEmail']);
             }
         }
         if (!empty($listDest) || !empty($listSent) || !empty($listIds)) {
             $data = array('list' => $listSent, 'dest' => $listDest, 'ids' => $listIds);
             $this->_adminNotification($data);
             $this->_logSending($data);
         }
     }
 }
開發者ID:anunay,項目名稱:stentors,代碼行數:39,代碼來源:IndexController.php


注:本文中的Zend_Date::compareTimestamp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。