Convert date to ordinal python?
<p>I want to convert
2010-03-01 to 733832</p>

<p>I just found this toordinal code</p>

<pre><code>d=datetime.date(year=2010, month=3, day=1)
d.toordinal()
</code></pre>

<p>from <a href="http://stackoverflow.com/questions/16542074/what-is-the-inverse-of-date-toordinal-in-python">this</a></p>

<p>But i want something more like</p>

<pre><code>d=datetime.date('2010-03-01')
d.toordinal()
</code></pre>

<p>Thanks in advance</p>

<p>like this:</p>

<pre><code>datetime.strptime("2016-01-01", "%Y-%m-%d").toordinal()
</code></pre>

python datetime