title: Preserve one column in timestamp format when write pd.to_csv
body: <p>I need to write the following dataframe to csv:</p>
  <pre><code>prodid    value           timestamp  
  322         4           2021-11-03 17:32:12.252   
  123        34           2021-11-03 18:42:12.602
  ...
  </code></pre>
  <p>or</p>
  <pre><code>import datetime
  
  df = pd.DataFrame([(0, 4, datetime.datetime.strptime(&quot;2021-11-03 14:32:13.4)02&quot;, &quot;%Y-%m-%d %H:%M:%S.%f&quot;), 
                     (1, 34, datetime.datetime.strptime(&quot;2021-11-03 18:42:12.602&quot;, &quot;%Y-%m-%d %H:%M:%S.%f&quot;))],
                     columns=['prodid', 'value', 'timestamp'])
  
  </code></pre>
  <p>When I write this to csv in a <code>StringIO</code> buffer:</p>
  <pre><code>import io
  
  io_buff = io.StringIO()
  df.to_csv(io_buff, sep='\t', header=False, index=False)
  </code></pre>
  <p>column <code>timestamp</code> is no longer preserved as <code>datetime</code>. When I further process this <code>io_buff</code>, such as writing it to a Postgres table, column <code>timestamp</code> is written as <code>numeric</code>.</p>
  <p>How do I preserve the timestamp format when writing it with <code>pd.to_csv()</code>?</p>