Freemarker gets the current timestamp

How to get the current timestamp (seconds since 01/01/1970) in freemarker file? I know .nowvar, but I did not understand how to get the base timestamp format.

+4
source share
1 answer

Use the operator ?long:

.now?long

for milliseconds or

${.now?long / 1000}

in seconds

+5
source

All Articles