incorrect date format when writing df to csv pandas
<p>I convert a string to date using pandas.
When I write the DF to CSV, the date comes like '2016-08-15 instead of plain 2016-08-15. Unable to read it as date in ETL tool.Same is the case for all date fields.</p>

<p>Any suggestion to get the date format correctly ?</p>

<pre><code>df =pd.read_csv(r'/Users/tcssig/Documents/ABP_News_Aug01.csv', parse_dates=['Dates'])
</code></pre>

<p>df.to_csv('/Users/tcssig/Documents/Sarang.csv')</p>

<p>You can try this</p>

<pre><code>df = pd.read_csv(r'/Users/tcssig/Documents/ABP_News_Aug01.csv')
df['date'] = pd.to_datetime(df['date'])
df.to_csv('/Users/tcssig/Documents/Sarang.csv')
</code></pre>

<p>(assuming name of the date field is 'date'</p>

python pandas