Php Zend Framework 2日期格式帮助程序
如何通过以下方式获得4位数的年号:Php Zend Framework 2日期格式帮助程序,php,zend-framework2,date-formatting,view-helpers,Php,Zend Framework2,Date Formatting,View Helpers,如何通过以下方式获得4位数的年号: echo $this->dateFormat( new DateTime(), IntlDateFormatter::SHORT, // date IntlDateFormatter::NONE, // time "nl_NL"); 现在我得到:01-01-14(2014年1月1日) 但我想:01-01-2014我不确定,但您可以使用以下内容: $dateString = Zend_Locale_Format::getDate( date('d
echo $this->dateFormat(
new DateTime(),
IntlDateFormatter::SHORT, // date
IntlDateFormatter::NONE, // time
"nl_NL");
现在我得到:01-01-14
(2014年1月1日)
但我想:
01-01-2014
我不确定,但您可以使用以下内容:
$dateString = Zend_Locale_Format::getDate(
date('d-m-Y'),
array(
'date_format' => 'dd.MM.yyyy',
)
);
或者只需使用date()
查看以下内容: