title: Converting all datetime columns ('<M8[ns]') to show only date values when outputting to HTML
body: <p>My project involves taking a wide array of SQL queries, converting them to dataframes in python via pandas, filtering by a user name column and then outputing the filtered dataframes to individual HTML files which are converted to PDFs and published.</p>
  
  <p>I'm stuck on an issue where when the date columns appear in the HTML, they are YY-MM-DD-HH-MM-SS but i'd just like them to be YY-MM-DD to make the PDF output look cleaner.</p>
  
  <p>I know that i can convert a single named column to the desired output using:</p>
  
  <pre><code>dataset['datecolumn'] = dataset['datecolumn'].dt.date
  </code></pre>
  
  <p>I did manage to solve the problem using the above approach by getting a list of the column names and then applying a for loop as below:</p>
  
  <pre><code>datecollist = list(dataset.select_dtypes(include=['datetime64']).columns)
  for i in datecollist:
      dataset[i] = dataset[i].dt.date
  </code></pre>
  
  <p>However I would really like to figure out a more pythonic way of fixing this problem as I want to avoid a further for loop in my code and to improve by python ability.</p>
  
  <p>So far I attempted a mapper function without any luck:</p>
  
  <pre><code>mapper = lambda x: x.dt.date if isinstance(x, np.datetime64) else x
  dataset.columns = dataset.columns.map(mapper)
  </code></pre>
  
  <p>It just seemed to skip out the columns that I'm looking to convert. I noticed that when I check the dtype of these columns they show up as:</p>
  
  <pre><code>in: dataset['First Date'].dtype
  out: dtype('&lt;M8[ns]')
  </code></pre>
  
  <p>Can anyone suggest where my mapper approach is going wrong, or show me a more efficient/cleaner way of solving the problem?</p>