本文整理汇总了PHP中sfCultureInfo::getDateTimeFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP sfCultureInfo::getDateTimeFormat方法的具体用法?PHP sfCultureInfo::getDateTimeFormat怎么用?PHP sfCultureInfo::getDateTimeFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfCultureInfo
的用法示例。
在下文中一共展示了sfCultureInfo::getDateTimeFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: catch
$t->fail('__get() throws an exception if the property does not exist');
} catch (sfException $e) {
$t->pass('__get() throws an exception if the property does not exist');
}
// __set()
$t->diag('__set()');
try {
$c->NonExistant = 12;
$t->fail('__set() throws an exception if the property does not exist');
} catch (sfException $e) {
$t->pass('__set() throws an exception if the property does not exist');
}
// ->getDateTimeFormat()
$t->diag('->getDateTimeFormat()');
$c = new sfCultureInfo();
$t->isa_ok($c->getDateTimeFormat(), 'sfDateTimeFormatInfo', '->getDateTimeFormat() returns a sfDateTimeFormatInfo instance');
// ->setDateTimeFormat()
$t->diag('->setDateTimeFormat()');
$d = $c->getDateTimeFormat();
$c->setDateTimeFormat('yyyy');
$t->is($c->getDateTimeFormat(), 'yyyy', '->setDateTimeFormat() sets the sfDateTimeFormatInfo instance');
$c->DateTimeFormat = 'mm';
$t->is($c->getDateTimeFormat(), 'mm', '->setDateTimeFormat() is equivalent to ->DateTimeFormat = ');
// ->getNumberFormat()
$t->diag('->getNumberFormat()');
$c = new sfCultureInfo();
$t->isa_ok($c->getNumberFormat(), 'sfNumberFormatInfo', '->getNumberFormat() returns a sfNumberFormatInfo instance');
// ->setNumberFormat()
$t->diag('->setNumberFormat()');
$d = $c->getNumberFormat();
$c->setNumberFormat('.');