我已阅读CakePHP 3的文档:http://book.cakephp.org/3.0/en/core-libraries/time.html#dates
在我的AppController.php中,我添加了
use Cake\I18n\Date;
$date = new Date('2015-06-15');
$date->setTimezone(new \DateTimeZone('Germany/Berlin'));
我收到以下错误:
Error: Class 'Cake\I18n\Date' not found.
这有什么不对吗?
我只是想在我的视图中显示当前日期。
提前致谢。
答案 0 :(得分:2)
您引用的类是CakePHP 3.2的新增功能 - 您的版本目前是3.1.x.
导航到您的站点目录并运行命令composer update