如何在 Twig 中以正确的格式显示年份?
How to display year in correct format in Twig?
我无法显示正确的年份格式。我在数据库 28-04-2021
中有一个日期列,但 twig 给了我 28-04-2121
.
我的代码:
{{t.dateLeasing|date("d-m-yy}}
你想要Y
。 yy
表示年份的两位数表示,两次.
{{t.dateLeasing|date("d-m-Y")}}
我无法显示正确的年份格式。我在数据库 28-04-2021
中有一个日期列,但 twig 给了我 28-04-2121
.
我的代码:
{{t.dateLeasing|date("d-m-yy}}
你想要Y
。 yy
表示年份的两位数表示,两次.
{{t.dateLeasing|date("d-m-Y")}}