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


PHP Zend_Date::subIso方法代碼示例

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


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

示例1: testLoose


//.........這裏部分代碼省略.........
         // success
     }
     try {
         $date->addDate(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->subDate(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->compareDate(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->setIso(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->addIso(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->subIso(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->compareIso(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->setArpa(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->addArpa(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->subArpa(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
         // success
     }
     try {
         $date->compareArpa(null);
         $this->fail();
     } catch (Zend_Date_Exception $e) {
開發者ID:jsnshrmn,項目名稱:Suma,代碼行數:67,代碼來源:DateTest.php

示例2: testSubIso

 /**
  * Test for subIso
  */
 public function testSubIso()
 {
     $locale = new Zend_Locale('de_AT');
     $date = new Zend_Date(1234567890, null, $locale);
     $d2 = new Zend_Date(1234567899, null, $locale);
     $result = $date->subIso(Zend_Date::now());
     $this->assertTrue($result instanceof Zend_Date);
     $date = new Zend_Date(1234567890, null, $locale);
     $result = $date->subIso('0000-00-00T01:00:00+0100');
     $this->assertSame($result->get(Zend_Date::W3C), '2009-02-14T00:31:30+01:00');
     $this->assertSame($date->get(Zend_Date::W3C), '2009-02-14T00:31:30+01:00');
     $result = $date->subIso('0001-01-01T01:01:01+0100');
     $this->assertSame($date->get(Zend_Date::W3C), '2008-01-14T00:30:29+01:00');
     $date = new Zend_Date(1234567890, null, $locale);
     $date->subIso($d2);
     $this->assertSame($date->get(Zend_Date::W3C), '-1-12-06T00:59:51+01:00');
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:20,代碼來源:DateTest.php


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