本文整理汇总了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);
}