title: split date and time in different columns of dataframe in R
body: <p>I have a following dataframe in R</p>
  
  <pre><code>ID       Date1              Date2       
  
  1        21-03-16 8:36      22-03-16 12:36
  1        23-03-16 9:36      24-03-16 01:36
  1        22-03-16 10:36     25-03-16 11:46
  1        23-03-16 11:36     28-03-16 10:16
  </code></pre>
  
  <p>My desired dataframe is</p>
  
  <pre><code>ID    Date1        Date1_time    Date2          Date2_time
  1     2016-03-21   08:36:00      2016-03-22     12:36:00
  1     2016-03-23   09:36:00      2016-03-24     01:36:00
  1     2016-03-22   10:36:00      2016-03-25     11:46:00
  1     2016-03-23   11:36:00      2016-03-28     10:16:00
  </code></pre>
  
  <p>I can do this individually using <code>strptime</code> like following</p>
  
  <pre><code>df$Date1 &lt;- strptime(df$Date1, format='%d-%m-%y %H:%M')
  df$Date1_time &lt;-  strftime(df$Date1 ,format="%H:%M:%S")
  df$Date1 &lt;- strptime(df$Date1, format='%Y-%m-%d')
  </code></pre>
  
  <p>But,I have many date columns to convert like above. How can I write function in R which will do this.</p>