按区域设置的PHP格式日期(分隔符,顺序不是文本)
例如,2014年2月22日vs 2014年2月22日或2014年2月22日 strftime已经需要固定格式,只需更改文本 是否可能(PHP5.3-大型基础设施,尚未更新)使用setlocale并根据本地规范格式化日期按区域设置的PHP格式日期(分隔符,顺序不是文本),php,date,localization,Php,Date,Localization,例如,2014年2月22日vs 2014年2月22日或2014年2月22日 strftime已经需要固定格式,只需更改文本 是否可能(PHP5.3-大型基础设施,尚未更新)使用setlocale并根据本地规范格式化日期 $dt = new DateTime($datetime); $formatter = new IntlDateFormatter($locale, IntlDateFormatter::SHORT, IntlDateFormatter::SHORT); return $form
$dt = new DateTime($datetime);
$formatter = new IntlDateFormatter($locale, IntlDateFormatter::SHORT, IntlDateFormatter::SHORT);
return $formatter->format($dt);
在四处挖掘之后,这是我发现的最近的一个