title: Format and Sort date and time in Python
body: <p>I imported csv file to Python and it looks like</p>
  
  <pre><code>ric       date           time       price
  VOD   01-AUG-2013     8:08:53.241    156
  VOD   03-JAN-2013     8:25:43.241    129
  VOD   07-MAR-2013     8:03:31.241    128
  VOD   18-AUG-2013     8:18:53.241    120
  ...     ...              ...         ...
  </code></pre>
  
  <p>I need to sort this file by <code>date</code> and then by <code>time</code> from the oldest to newest.
  However, I have to format the <code>date</code> and <code>time</code> first. But I am not sure how to do that. I tired to format <code>date</code> first, but it did work out.</p>
  
  <p>My code is:</p>
  
  <pre><code>import pandas as pd
  import time
  import datetime
  from datetime import datetime
  
  path = 'C:\\sample.csv'
  
  data= pd.read_csv(path)
  sorted(data, key=lambda each_dict: datetime.strptime(each_dict['date'], '%d-%b-%y'))
  </code></pre>
  
  <p>Can someone help me to format and sort <code>date</code> and <code>time</code> ? thanks !</p>