Is it possible to print current date in specified format (Y-m-d H:i:s) in ftl (FreeMarker) ?
I want to avoid passing date from controller to view.
Freemarker is a templating library, there isn't a today variable, you should consider passing a new Date() Java Object to the template, and format it. Consider to create a wrapper class for this, to generate the new Date() exactly at the time it is called.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With