title: R: Aggregating by dates with POSIXct?
body: <p>I have some zoo series that use POSIXct index.</p>
  
  <p>In order to aggregate by days I've tried these two ways:</p>
  
  <pre><code>aggregate(myzoo,format((index((myzoo)),"%Y-%m-%d")),sum)
  
  aggregate(myzoo,as.Date(index(myzoo)),sum)
  </code></pre>
  
  <p>I don't know why they don't give the same output.
  myzoo series had the weekends removed.   The "as.Date way" seems to be OK but the  "format way" aggregation gives me data on the weekends.</p>
  
  <p>Why?</p>
  
  <p>Which one is the right?</p>
  
  <p>I've even tried it <code>as.POSIXct(format(...))</code></p>