title: Convert airflow macro 'ts' into datetime object
body: <p>I encountered a problem with converting the airflow macros reference 'ts' into a datetime object. The problem is with the <em>tz</em> at the end of the string.</p>
  
  <pre class="lang-py prettyprint-override"><code>from datetime import datetime
  timetoday = kwargs['ts']
  t = datetime.strptime(timetoday, '%Y-%m-%dT%H:%M:%S%z')
  </code></pre>
  
  <p>The code didn't execute successfully, instead it throws an error message:</p>
  
  <pre><code>time data '2019-08-24T00:00:00+00:00' does not match format '%Y-%m-%dT%H:%M:%S%z'
  </code></pre>
  
  <p>If I used the same code with slightly different format, and try with 'ds' macros, and I managed to convert the string into datetime object.</p>
  
  <pre class="lang-py prettyprint-override"><code>from datetime import datetime
  timetoday = kwargs['ds']
  t = datetime.strptime(timetoday, '%Y-%m-%d')
  </code></pre>
  
  <p><strong>Update:</strong> Reading the notes from <a href="http://strftime.org/" rel="noreferrer">http://strftime.org/</a> and understand that <em><code>%z</code> is UTC offset in the form <strong>+HHMM</strong> or <strong>-HHMM</strong> (empty string if the the object is naive).</em> This led me wondering whether the additional <code>':'</code> in between <code>+00:00</code> (returned string of <code>kwargs['ts']</code> is the root cause of the error. However, I'm still unsure how to parse it correctly, as there were no other options in <code>strptime</code>.</p>
  
  <p>Therefore, I change my macro to <code>kwargs['ts_nodash']</code> that doesn't return the timezone, and proceed with my code for now. If anyone knows how to do it, I'm still interested to learn how that can be done correctly! Thanks!</p>
  
  <pre class="lang-py prettyprint-override"><code>timetoday = kwargs['ts_nodash']
  t = datetime.strptime(timetoday, '%Y%m%dT%H%M%S')
  </code></pre>