title: Filtering and comparing dates with Pandas
body: <p>I would like to know how to filter different dates at all the different time levels, i.e. find dates by year, month, day, hour, minute and/or day. For example, how do I find all dates that happened in 2014 or 2014 in the month of January or only 2nd January 2014 or ...down to the second?</p>
  
  <p>So I have my date and time dataframe generated from <strong>pd.to_datetime</strong></p>
  
  <pre><code>df
      timeStamp
  0   2014-01-02 21:03:04
  1   2014-02-02 21:03:05
  2   2016-02-04 18:03:10
  </code></pre>
  
  <p>So if I filter by the year 2014 then I would have as output:</p>
  
  <pre><code>    timeStamp
  0   2014-01-02 21:03:04
  1   2014-02-02 21:03:05
  </code></pre>
  
  <p>Or as a different example I want to know the dates that happened in 2014 and at the 2nd of each month. This would also result in:</p>
  
  <pre><code>    timeStamp
  0   2014-01-02 21:03:04
  1   2014-02-02 21:03:05
  </code></pre>
  
  <p>But if I asked for a date that happened on the 2nd of January 2014</p>
  
  <pre><code>    timeStamp
  0   2014-01-02 21:03:04
  </code></pre>
  
  <p>How can I achieve this at all the different levels? </p>
  
  <p>Also how do you compare dates at these different levels to create an array of boolean indices?</p>