本文整理匯總了PHP中TimeHelper::nice方法的典型用法代碼示例。如果您正苦於以下問題:PHP TimeHelper::nice方法的具體用法?PHP TimeHelper::nice怎麽用?PHP TimeHelper::nice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TimeHelper
的用法示例。
在下文中一共展示了TimeHelper::nice方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: nice
public function nice($dateString = null, $timezone = null, $format = null)
{
if (empty($format)) {
$format = Configure::read('App.l10n.dateFormat');
}
return ucfirst(parent::nice($dateString, $timezone, $format));
}
示例2: getProgress
function getProgress($data)
{
App::import('Helper', 'Time');
$time = new TimeHelper();
if (is_array($data)) {
if (!empty($data['ImportStatus'])) {
switch ($data['ImportStatus']['id']) {
case 1:
return sprintf(__($data['ImportStatus']['message'], true), $time->nice($data['ImportUpload']['created']));
break;
case 2:
return __($data['ImportStatus']['message'], true);
break;
case 3:
return __($data['ImportStatus']['message'], true);
break;
case 4:
return __($data['ImportStatus']['message'], true);
break;
case 5:
return sprintf(__($data['ImportStatus']['message'], true), $data['ImportUpload']['total_imported'], $data['ImportUpload']['total']);
break;
case 6:
return __($data['ImportStatus']['message'], true);
break;
default:
return __('Import has no status', true);
}
}
}
}
示例3: nice
/**
* Returns a nicely formatted date string for given Datetime string.
*
* @param string $dateString Datetime string or Unix timestamp
* @param int $userOffset User's offset from GMT (in hours)
* @return string Formatted date string
* @access public
* @link http://book.cakephp.org/view/1471/Formatting
*/
function nice($dateString = null, $userOffset = null)
{
return parent::nice($dateString, $this->__userOffset($dateString, $userOffset));
}