本文整理匯總了PHP中DateTimeUtil::resolveTimeStampForDateTimeLocaleFormattedDisplay方法的典型用法代碼示例。如果您正苦於以下問題:PHP DateTimeUtil::resolveTimeStampForDateTimeLocaleFormattedDisplay方法的具體用法?PHP DateTimeUtil::resolveTimeStampForDateTimeLocaleFormattedDisplay怎麽用?PHP DateTimeUtil::resolveTimeStampForDateTimeLocaleFormattedDisplay使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DateTimeUtil
的用法示例。
在下文中一共展示了DateTimeUtil::resolveTimeStampForDateTimeLocaleFormattedDisplay方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renderValue
/**
* Renders value.
* @param string $value
* @return string
*/
public function renderValue($value)
{
$value = strtotime($value);
if ($value == ZurmoTimeZoneHelper::getTimeZoneOffset()) {
return Zurmo::t('Core', '(None)');
}
$dateTime = date('Y-m-d H:i:s', $value);
return DateTimeUtil::resolveTimeStampForDateTimeLocaleFormattedDisplay($dateTime);
}
示例2: testResolveTimeStampForDateTimeLocaleFormattedDisplay
public function testResolveTimeStampForDateTimeLocaleFormattedDisplay()
{
$value = strtotime("3 June 1980");
$displayValue = DateTimeUtil::resolveTimeStampForDateTimeLocaleFormattedDisplay($value);
$this->assertEquals('6/3/80 12:00 AM', $displayValue);
//other locales
Yii::app()->setLanguage('de');
$value = strtotime("3 June 1980");
$displayValue = DateTimeUtil::resolveTimeStampForDateTimeLocaleFormattedDisplay($value);
$this->assertEquals('03.06.80 00:00', $displayValue);
}
示例3: testResolveTimeStampForDateTimeLocaleFormattedDisplay
public function testResolveTimeStampForDateTimeLocaleFormattedDisplay()
{
$value = strtotime("3 June 1980");
$displayValue = DateTimeUtil::resolveTimeStampForDateTimeLocaleFormattedDisplay($value);
$this->assertEquals('6/3/80 12:00 AM', $displayValue);
//For input
$value = strtotime("3 June 1920");
$displayValue = DateTimeUtil::resolveTimeStampForDateTimeLocaleFormattedDisplay($value, DateTimeUtil::DATETIME_FORMAT_DATE_WIDTH, DateTimeUtil::DATETIME_FORMAT_TIME_WIDTH, true);
$this->assertEquals('6/3/1920 12:00 AM', $displayValue);
//other locales
Yii::app()->setLanguage('de');
$value = strtotime("3 June 1980");
$displayValue = DateTimeUtil::resolveTimeStampForDateTimeLocaleFormattedDisplay($value);
$this->assertEquals('03.06.80 00:00', $displayValue);
//For input
$value = strtotime("3 June 1920");
$displayValue = DateTimeUtil::resolveTimeStampForDateTimeLocaleFormattedDisplay($value, DateTimeUtil::DATETIME_FORMAT_DATE_WIDTH, DateTimeUtil::DATETIME_FORMAT_TIME_WIDTH, true);
$this->assertEquals('03.06.1920 00:00', $displayValue);
}