Skip to main content
2 of 2
added 113 characters in body
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

Are you saying this is not a real datetime object, and it's just the date filter making it look like it? I'm finding some unpredictability, too, as you know.

Clive Portman
  • 2.9k
  • 19
  • 36