title: How to automatically detect columns that contain datetime in a pandas dataframe
body: <p>I'm using Pandas' read_sql() function to read multiple SQL tables into DataFrames. This function requires a pre-specified list of column names which should be read as datetime objects using the 'parse_dates' parameter but the function does not infer datetimes automatically from varchar columns in the server. Because of this, I get DataFrames in which all columns are of dtype Object.</p>
  
  <pre><code>   col1    col2
     -----------------------------------
  0  A       2017-02-04 10:41:00.0000000
  1  B       2017-02-04 10:41:00.0000000
  2  C       2017-02-04 10:41:00.0000000
  3  D       2017-02-04 10:41:00.0000000
  4  E       2017-02-03 06:13:00.0000000
  </code></pre>
  
  <p>Is there a built-in Pandas function to automatically infer columns which should be datetime64[ns] <strong>WITHOUT</strong> having to specify the column names?</p>
  
  <p>I've tried:</p>
  
  <pre><code>df.apply(pd.to_datetime(df, infer_datetime_format=True), axis=1)
  </code></pre>
  
  <p>which results in an error:</p>
  
  <pre><code>to assemble mappings requires at least that [year, month, day] be specified: [day,month,year] is missing
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>pd.to_datetime(df.stack(),  errors='ignore', format='%Y%m%d% H%M%S%f').unstack()
  </code></pre>
  
  <p>and</p>
  
  <pre><code>pd.to_datetime(df.stack(),  errors='coerce', format='%Y%m%d% H%M%S%f').unstack()
  </code></pre>
  
  <p>But this does not work.</p>
  
  <p>Any suggestions about how to infer datetime columns automatically after the DataFrame is constructed?</p>