title: Changing date time format in R
body: <p>I have a table with two columns "start" and "end" containing both dates and times of the respective start and end period as follows:</p>
  
  <pre><code>Sr. No.    Start                 End
  1          22May2001:00:00:00    27May2001:23:59:59
  2          28May2001:00:00:00    26Jun2001:23:59:59
  </code></pre>
  
  <p>I would like to convert above date time in the following format (ISO8601 with time stamp):</p>
  
  <pre><code>Sr. No.    Start                 End
  1          2001-05-22 00:00:00   2001-05-27 23:59:59
  2          2001-05-28 00:00:00   2001-06-26 23:59:59
  </code></pre>
  
  <p>I have used the code available at this link: <a href="http://www.stat.berkeley.edu/~s133/dates.html" rel="nofollow">http://www.stat.berkeley.edu/~s133/dates.html</a></p>
  
  <pre><code>View(my_table)
  str(my_table)
  my_table$startD &lt;- as.Date(my_table$start, "%d%b%Y:%H:%M:%S")
  my_table$startT &lt;- strptime(my_table$start, format = "%d%b%Y:%H:%M:%S")
  </code></pre>
  
  <p>So far, my attempt gave me two columns like this:</p>
  
  <pre><code>StartD       StartT
  2001-05-22   2001-05-22
  </code></pre>
  
  <p>Which is not desirable. Could someone please suggest me to convert the date time in desired format through above or any alternate approach?</p>