本文整理汇总了PHP中Zend_Gdata_App_Util::formatTimestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_App_Util::formatTimestamp方法的具体用法?PHP Zend_Gdata_App_Util::formatTimestamp怎么用?PHP Zend_Gdata_App_Util::formatTimestamp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Gdata_App_Util
的用法示例。
在下文中一共展示了Zend_Gdata_App_Util::formatTimestamp方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testExceptionFormatTimestampInvalid
public function testExceptionFormatTimestampInvalid()
{
$util = new Zend_Gdata_App_Util();
try {
$ts = Zend_Gdata_App_Util::formatTimestamp('nonsense string');
} catch (Zend_Gdata_App_Exception $e) {
$this->assertEquals('Invalid timestamp: nonsense string.', $e->getMessage());
}
}
示例2: testStartMinMaxParam
public function testStartMinMaxParam()
{
$this->query->resetParameters();
$startMin = '2006-10-30';
$startMax = '2006-11-01';
$this->query->setUser(self::GOOGLE_DEVELOPER_CALENDAR);
$this->query->setStartMin($startMin);
$this->query->setStartMax($startMax);
$this->assertTrue($this->query->startMin != null);
$this->assertTrue($this->query->startMax != null);
$this->assertEquals(Zend_Gdata_App_Util::formatTimestamp($startMin), $this->query->getStartMin());
$this->assertEquals(Zend_Gdata_App_Util::formatTimestamp($startMax), $this->query->getStartMax());
$this->query->startMin = null;
$this->assertFalse($this->query->startMin != null);
$this->query->startMax = null;
$this->assertFalse($this->query->startMax != null);
$this->query->user = null;
$this->assertFalse($this->query->user != null);
}
示例3: setRecurrenceExpansionEnd
/**
* @return string recurrence-expansion-end
*/
public function setRecurrenceExpansionEnd($value)
{
if ($value != null) {
$this->_params['recurrence-expansion-end'] = Zend_Gdata_App_Util::formatTimestamp($value);
} else {
unset($this->_params['recurrence-expansion-end']);
}
return $this;
}
示例4: setPublishedMin
/**
* @param string $value
* @return Zend_Gdata_Query Provides a fluent interface
*/
public function setPublishedMin($value)
{
if ($value != null) {
$this->_params['published-min'] = Zend_Gdata_App_Util::formatTimestamp($value);
} else {
unset($this->_params['published-min']);
}
return $this;
}
示例5: testExceptionFormatTimestampInvalidOffsetHours
public function testExceptionFormatTimestampInvalidOffsetHours()
{
$util = new Zend_Gdata_App_Util();
try {
$ts = Zend_Gdata_App_Util::formatTimestamp('2007-06-05T02:51:12-ab:00');
} catch (Zend_Gdata_App_Exception $e) {
$this->assertEquals('Invalid timestamp: 2007-06-05T02:51:12-ab:00.', $e->getMessage());
return;
}
// Excetion not thrown, this is bad.
$this->fail("Exception not thrown.");
}
示例6: testFormatTimestepHandlesSmallUnixTimestampProperly
/**
* @group ZF-11610
*/
public function testFormatTimestepHandlesSmallUnixTimestampProperly()
{
$this->assertEquals('1970-01-01T00:02:03+00:00', Zend_Gdata_App_Util::formatTimestamp(123));
}