Skip to main content
1 of 2
Clive Portman
  • 2.9k
  • 19
  • 36

This works for me, starting with a string:

{% set yearbegins = '1 January ' ~ year %} // getting year from a url (dynamic route)
{{ yearbegins | date("U") }} // outputs the date in Unixtime

But, like you, I'm finding some unpredictability.

Clive Portman
  • 2.9k
  • 19
  • 36