Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

How to separate time and date from columns

$
0
0

I have a dataset df. It has a column that has both date and time. Can we separate this

df
ColA    ColB
A      2020-01-17T03:30:37-05:00
B      2020-01-17T03:30:38-05:00 
C      2020-01-17T03:30:39-05:00

Expected output

df
ColA    ColB                           ColC             ColD             ColE
A      2020-01-17T03:30:37-05:00     2020-01-17     03:30:37            05:00 
B      2020-01-17T03:30:38-05:00     2020-01-17     03:30:38            05:00 
C      2020-01-17T03:30:39-05:00     2020-01-17     03:30:39            05:00 

Viewing all articles
Browse latest Browse all 201867

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>