How to extract only the month and day from a datetime object?
<p>I was trying to do a scatterplot, and my x-axis needs to be each individual day in a year. 
I first read in the datafile and get the date column, which are filled with integers like, 19800801. So I convert this <code>integer</code> to <code>datetime</code> by writing:</p>

<pre><code>datetimes_0 = datetime.strptime(str(dates_pitts[0]), '%Y%m%d')
</code></pre>

<p>Then I want to extract only the month and day from the datetime object by writing:</p>

<pre><code>s = datetimes_0.strftime("%m%d")
</code></pre>

<p>I realized that they return value from <code>strftime</code> is no longer a datetime object so I tried converting it back to datetime object by doing</p>

<pre><code>s0= datetime.strptime(s, '%m%d')
</code></pre>

<p>But instead of giving me only the month and day, it gives me back the whole year, month and day.
My question is how do I extract a datetime object of only the month and day(both) from a given integer like 19800801?</p>