4

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.

Julien
  • 2,616
  • 1
  • 30
  • 43

1 Answers1

5

Use the ?long operator:

.now?long

for milliseconds, or

${.now?long / 1000}

for seconds

Bohemian
  • 412,405
  • 93
  • 575
  • 722