Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Zend Framework 2日期格式帮助程序_Php_Zend Framework2_Date Formatting_View Helpers - Fatal编程技术网

Php Zend Framework 2日期格式帮助程序

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

如何通过以下方式获得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-m-Y'),
    array(
        'date_format' => 'dd.MM.yyyy',
    )
);
或者只需使用
date()

查看以下内容: