title: Python: Handling Date/Time with AM/PM information
body: <p>In my Excel data, column 1 is titled 'Time'. It contains data and time information as follow: 7/26/2018 2:15:00 AM</p>
  
  <p>In my python code, I am trying to use pd.to_datetime to convert it into date/time format. </p>
  
  <p>Here is my code. It looks correct but it doesn't work. </p>
  
  <pre><code>import pandas as pd
  import numpy as np
  import math
  import matplotlib.pyplot as plt
  import datetime
  
  
  #Basis 
  pf=0.9
  datatimeinterval_mins = 15
  
  #Pump/fan design specs
  des_ampere = 327
  des_voltage_kv = 3.3
  des_kw = 1600
  des_flow_nm3s = 49.9
  lowclamp=35
  
  min_flowratio = lowclamp/50
  
  print(min_flowratio)
  
  #Load dataset
      df = pd.read_excel(r'C:\Users\Z003V0EE\Desktop\Python Test\Datasetrev0.xlsx', sheet_name=0, parse_date=[0])
      print(df.head())
  
      #Set index
      df['Time'] = pd.to_datetime(df['Time'], format='%m/%d/%y %H:%M:%S %p')
      df.set_index('Time', inplace=True)
  
      #actual operating parameters
      df['actualkw'] = (df.PAF2Current * des_voltage_kv * 0.9 * np.math.sqrt(3))
      df['actualflowratio'] = (df.PAF2AirFlow / des_flow_nm3s)
      df['expectedkw'] = (df.actualflowratio**3 * des_kw)
      df['kwsavings'] = (df.actualkw - df.expectedkw)
  
      df =  df.round(2)
      print(df.head())
  
      plt.plot(df.index, df.PAF2AirFlow)
  </code></pre>
  
  <p>Can anyone spot my mistake please? </p>
  
  <p>I get the following error:
  ValueError: time data '7/26/2018 2:15:00 AM' does not match format '%m/%d/%y %H:%M:%S %p' (match)</p>
  
  <p>Thanks in advance. </p>