Md Mehedi Hasan
Md Mehedi Hasan

Reputation: 1792

How can I get timestamp value in Twig?

How can I get timestamp value in twig as I know date formatting is possible in twig but don't know how to get timestamp value using twig function;

Upvotes: 39

Views: 62529

Answers (2)

greg
greg

Reputation: 1927

There is other solution that might be easier to understand by designers.

{{ 'now'|date('U') }}

(I am aware that the question is already answered and it's old)

Upvotes: 88

xiidea
xiidea

Reputation: 3394

You can use this

{{ date().timestamp }}

Upvotes: 75

Related Questions