title: Strip the date and keep the time
body: <p>Lots of people ask how to strip the time and keep the date, but what about the other way around?  Given:</p>
  
  <pre><code>myDateTime &lt;- "11/02/2014 14:22:45"
  </code></pre>
  
  <p>I would like to see:</p>
  
  <pre><code>myTime
  [1] "14:22:45"
  </code></pre>
  
  <p>Time zone not necessary.</p>
  
  <p>I've already tried (from other answers)</p>
  
  <pre><code>as.POSIXct(substr(myDateTime, 12,19),format="%H:%M:%S")
  </code></pre>
  
  <p>[1] "2013-04-13 14:22:45 NZST"</p>
  
  <p>The purpose is to analyse events recorded over several days by time of day only.</p>
  
  <p>Thanks</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>It turns out there's no pure "time" object, so every time must also have a date.</p>
  
  <p>In the end I used</p>
  
  <pre><code>as.POSIXct(as.numeric(as.POSIXct(myDateTime)) %% 86400, origin = "2000-01-01")
  </code></pre>
  
  <p>rather than the character solution, because I need to do arithmetic on the results.  This solution is similar to my original one, except that the date can be controlled consistently - "2000-01-01" in this case, whereas my attempt just used the current date at runtime.</p>