title: Jinja - email template, date time formatting with a variable
body: <p>This is driving me crazy, feels like it should be easier.</p>
  <p>Using Jinja code for a HTML email, in a drag and drop editor - so no access to the <code>&lt;head&gt;</code>!</p>
  <p>I have a date I’ve set as a variable the date format is YYYY-MM-DD HH:MM:SS</p>
  <p>I want to change the format using datetimeformat function, it works fine as <code>{{ today()|datetimeformat(&quot;%y-%m-%d&quot;) }}</code> - but I'll be buggered if I can exchange <code>today()</code> with my variable.</p>
  <pre><code>{% set bonusBeforeDate = linkedData.accessCodes[userAttribute['ReferralSource']]['promotion']['rules']['member_joined_date']['before'] %}
  </code></pre>
  <p>And then</p>
  <pre><code>{{ bonusBeforeDate|datetimeformat(&quot;%y-%m-%d&quot;) }}
  </code></pre>