I would like to display current date on my site using Twig. The problem is {{ "now"|date("Ymd") }}
function which display me random month number like " 2020-16-17 ". Every time when I rerun my Spring Boot program, the function shows different month number.
I solved my problem by change {{ "now"|date("Ymd") }}
to {{ "now"|date("Y-MM-d") }}
, "m" was showing minutes. Of course it is solution for Java.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.