使用time_diff时出现:diff.ago.hour;
解决:1:引入"knplabs/knp-time-bundle": "^1.7",https://github.com/KnpLabs/KnpTimeBundle
2:new Knp\Bundle\TimeBundle\KnpTimeBundle(),
3:配置config.yml
framework: #esi: ~ translator: { fallbacks: [‘%locale%‘] } 这样时间是显示正常了 2 小时前
时间: 2024-08-10 19:18:04