title: Sort by date with Excel file and Pandas
body: <p>I am trying to sort my Excel file by the date column. When the code runs it turns the cells from a text string to a time date and it sorts, but only within the same month. That is, when I have dates from October and September it completes by the month.</p>
  
  <p>I have been all over Google and YouTube.</p>
  
  <pre><code>import pandas as pd
  import datetime
  from datetime import timedelta
  
  x = datetime.datetime.now()
  
  excel_workbook = 'data.xlsx'
  sheet1 = pd.read_excel(excel_workbook, sheet_name='RAW DATA')
  
  sheet1['Call_DateTime'] = pd.to_datetime(sheet1['Call_DateTime'])
  
  sheet1.sort_values(sheet1['Call_DateTime'], axis=1, ascending=True, inplace=True)
  
  sheet1['SegmentDuration'] = pd.to_timedelta(sheet1['SegmentDuration'], unit='s')
  
  sheet1['SegmentDuration'] = timedelta(hours=0.222)
  
  sheet1.style.apply('h:mm:ss', column=['SegmentDuration'])
  
  sheet1.to_excel("S4x Output"+x.strftime("%m-%d")+".xlsx", index = False)
  
  print("All Set!!")
  </code></pre>
  
  <p>I would like it to sort oldest to newest.</p>