title: Format date conversion in r
body: <p>I am trying to read an excel file containing some date variable. But when I use the function to read the file and display the variable I get different format for two of my variables as in these following example.</p>
  <pre><code>date1
  [1] &quot;2009-05-22 UTC&quot; &quot;1995-09-13 UTC&quot; &quot;1996-03-20 UTC&quot; &quot;2006-17-05 UTC&quot; &quot;2005-09-25 UTC&quot; &quot;2004-12-15 UTC&quot; NA               NA               &quot;1997-05-30 UTC&quot;
  
  
  date2
  [1] &quot;2016-05-07 08:57:00 UTC&quot; &quot;2014-07-22 19:01:00 UTC&quot; &quot;2018-12-02 12:14:00 UTC&quot; &quot;2020-01-11 13:27:00 UTC&quot; &quot;2013-14-21 11:40:00 UTC&quot;
  [6] &quot;2019-08-15 09:31:00 UTC&quot; NA                        NA                        &quot;2016-07-23 00:00:00 UTC&quot;
  
  </code></pre>
  <p>How can I convert format of date2 in format of date1</p>