In: Computer Science
How do I convert a character column into date in R/Sql? The data
is in the format "01 02:52:12" i.e <day>
<hr>:<min>:<sec>
I want to convert this into Date time format.
SOURCE CODE: (R)
*Please follow the comments to better understand the code.
**Please look at the Screenshot below and use this code to copy-paste.
***The code in the below screenshot is neatly indented for better understanding.
========================
# Use
# %d for the day
# %H for hours
# %M for Minutes
# %S for seconds
# If you don't specify the year and month, it will take the
current year and month
date = as.Date("01 02:52:12",format="%d %H:%M:%S");
print(date);
=====================