title: How to extract correct date from POSIXct element?
body: <p>How can I get the correct date from the first column in my code?</p>
  
  <pre><code>test &lt;- data.frame(posixdate = c("2013-05-01 00:59:00", "2013-05-01 01:59:00", "2013-05-01 02:59:00", "2013-05-01 03:59:00"))
  test$posixdate &lt;- as.POSIXct(test$posixdate, format="%Y-%m-%d %H:%M:%S" )
  test$date &lt;- as.Date(test$posixdate)
  </code></pre>
  
  <p>The above code results in:</p>
  
  <pre><code>  posixdate           date
  1 2013-05-01 00:59:00 2013-04-30
  2 2013-05-01 01:59:00 2013-04-30
  3 2013-05-01 02:59:00 2013-05-01
  4 2013-05-01 03:59:00 2013-05-01
  </code></pre>
  
  <p>The first two dates are not correct. What did I do wrong?<br>
  If <code>as.Date()</code> is not the right function, how could I get the date (without hours, minutes, seconds) alternatively?</p>