title: R Extract day from datetime
body: <p>Hi I need to remain only with the day of each date:</p>
  
  <pre><code>df&lt;-data.frame(x=c("2014-07-24 00:00:00", 
  "2014-07-24 00:00:00", "2014-07-11", "2014-07-11" ,"2014-07-16" ,"2014-07-14"))
  as.Date(df$x,format="%Y-%m-%d" )
  </code></pre>
  
  <p>I tried this: </p>
  
  <pre><code>df$dia&lt;-as.Date(df$x, format="%d")
  </code></pre>
  
  <p>But I get a full date and different from the orginal.</p>
  
  <p>I don't want to install another package to do this.
  How can I solve it?
  Thanks</p>