title: Get year, month or day from numpy datetime64
body: <p>I have an array of datetime64 type:</p>
  
  <pre><code>dates = np.datetime64(['2010-10-17', '2011-05-13', "2012-01-15"])
  </code></pre>
  
  <p>Is there a better way than looping through each element just to get np.array of years:</p>
  
  <pre><code>years = f(dates)
  #output:
  array([2010, 2011, 2012], dtype=int8) #or dtype = string
  </code></pre>
  
  <p>I'm using stable numpy version 1.6.2.</p>