title: Combining gsub calls and remove character after last instance of a string
body: <p>I have the following string:</p>
  
  <pre><code>time &lt;- "2017-05-30T09:20:00-08:00"
  </code></pre>
  
  <p>I was to use <code>gsub</code> to produce this:</p>
  
  <p><code>"2017-05-30 09:20:00"</code></p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>time2 &lt;- gsub("T", " ", time)
  gsub("\\-.*", "", time2) 
  </code></pre>
  
  <p>Two questions - </p>
  
  <ol>
  <li>How do remove all characters after the <em>last</em> instance of <code>-</code>?</li>
  <li>How do I combine these two statements into one?</li>
  </ol>