本文整理匯總了PHP中FSS_Helper::getTimezone方法的典型用法代碼示例。如果您正苦於以下問題:PHP FSS_Helper::getTimezone方法的具體用法?PHP FSS_Helper::getTimezone怎麽用?PHP FSS_Helper::getTimezone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FSS_Helper
的用法示例。
在下文中一共展示了FSS_Helper::getTimezone方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Date
static function Date($date, $format = FSS_DATE_LONG, $format_custom = null)
{
//echo "In : $date<br>";
//echo "Format : " . $format . "<br>";
//echo "Offset : " . FSS_Settings::Get('timezone_offset') . "<br>";
if ((int) $date > 10000) {
$date = date("Y-m-d H:i:s", $date);
}
if ((int) FSS_Settings::Get('timezone_offset') != 0) {
$time = strtotime($date);
$time += 3600 * (int) FSS_Settings::Get('timezone_offset');
$date = date("Y-m-d H:i:s", $time);
}
switch ($format) {
case FSS_DATE_SHORT:
$ft = JText::_('DATE_FORMAT_LC4');
break;
case FSS_DATE_MID:
$ft = JText::_('DATE_FORMAT_LC3');
break;
case FSS_DATE_LONG:
$ft = JText::_('DATE_FORMAT_LC1');
break;
case FSS_TIME_SHORT:
$ft = 'H:i';
break;
case FSS_TIME_LONG:
$ft = 'H:i:s';
break;
case FSS_DATETIME_SHORT:
$ft = JText::_('DATE_FORMAT_LC4') . ', H:i';
break;
case FSS_DATETIME_MID:
$ft = JText::_('DATE_FORMAT_LC3') . ', H:i';
break;
case FSS_DATETIME_LONG:
$ft = JText::_('DATE_FORMAT_LC1') . ', H:i';
break;
case FSS_DATETIME_MYSQL:
$ft = 'Y-m-d H:i:s';
break;
case FSS_DATE_CUSTOM:
$ft = $format_custom;
break;
default:
$ft = JText::_('DATE_FORMAT_LC');
}
if ($format == FSS_DATETIME_SHORT && FSS_Settings::Get('date_dt_short') != "") {
$ft = FSS_Settings::Get('date_dt_short');
}
if ($format == FSS_DATETIME_MID && FSS_Settings::Get('date_dt_long') != "") {
$ft = FSS_Settings::Get('date_dt_long');
}
if ($format == FSS_DATE_SHORT && FSS_Settings::Get('date_d_short') != "") {
$ft = FSS_Settings::Get('date_d_short');
}
if ($format == FSS_DATE_MID && FSS_Settings::Get('date_d_long') != "") {
$ft = FSS_Settings::Get('date_d_long');
}
$date = new JDate($date, new DateTimeZone("UTC"));
$date->setTimezone(FSS_Helper::getTimezone());
//echo "Out : " . $date->format($ft, true) . "<br>";
return $date->format($ft, true);
}