title: Converting chr "00:00:00" to date-time "00:00:00"
body: <p>My question comes from <a href="https://stackoverflow.com/questions/25960517/how-to-convert-date-and-time-from-character-to-datetime-type/25960681?noredirect=1#comment40646875_25960681">this question</a>. The question had the following character string.</p>
  
  <pre><code>x &lt;- "2007-02-01 00:00:00"
  y &lt;- "02/01/2007 00:06:10"
  </code></pre>
  
  <p>If you try to convert this string to date-class object, something funny happens. </p>
  
  <p>This is a sample from @nrusell's answer.</p>
  
  <pre><code>as.POSIXct(x,tz=Sys.timezone())
  [1] "2007-02-01 EST"
  
  as.POSIXct(y,format="%m/%d/%Y %H:%M:%S",tz=Sys.timezone())
  [1] "2007-02-01 00:06:10 EST" 
  </code></pre>
  
  <p>As you see, <code>00:00:00</code> disappears from the first example. @Richard Scriven left the following example in our discussion using <code>lubridate</code>.</p>
  
  <pre><code>dt &lt;- as.POSIXct("2007-02-01 00:00:00")
  hour(dt) &lt;- hour(dt)+1
  dt
  [1] "2007-02-01 01:00:00 EST"
  hour(dt) &lt;- hour(dt)-1
  dt
  [1] "2007-02-01 EST"
  </code></pre>
  
  <p>Once again, <code>00:00:00</code> disappears. Why does R avoid keeping <code>00:00:00</code> in date-class object after conversion? How can we keep <code>00:00:00</code>?</p>