本文整理匯總了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) {
示例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');
}