title: Python getting hour from from timestamp
body: <p>I need to classify timestamps based on the hour, for example if it is between 7 AM and 9 AM, it will be morning. I have timestamps that I take from my csv file and I need to get only hour so I can classify the number with if statements.</p>
  
  <p>I will take the timestamps from <strong>date</strong> column and create a new column named <strong>hour</strong>, </p>
  
  <pre><code>df['hour'] = df.date.dt.hour
  </code></pre>
  
  <p>but it gives me the following error: <strong>AttributeError: Can only use .dt accessor with datetimelike values</strong></p>
  
  <p>Timestamps are like the following: 2016-03-14 17:24:55</p>