Get timestamp in seconds from python's datetime
<p>How to get timestamp from the structure datetime? What is right alternative for non-existing <code>datetime.utcnow().timestamp()</code>?</p>

<p>There is another stupid trick - achieve <code>timedelta</code> </p>

<pre><code>(datetime.utcnow()-datetime(1970,1,1,0,0,0)).total_seconds()
</code></pre>

<p>found <a href="http://stackoverflow.com/a/7852969/3743145">here</a>. <strong>Better</strong></p>

<pre><code>(datetime.utcnow()-datetime.fromtimestamp(0)).total_seconds()
</code></pre>

<p>And this solution contains subseconds.</p>

python timestamp