Reputation: 2756
How can I get the current timestamp (number of seconds since 01/01/1970) in a freemarker file? I know the .now var but I didn't figure how to get a basic timestamp format.
.now
Upvotes: 4
Views: 10090
Reputation: 425053
Use the ?long operator:
?long
.now?long
for milliseconds, or
${.now?long / 1000}
for seconds
Upvotes: 5