I need to convert a character class to a date time. The character format looks like this
1/3/2023 6:16am
I've tried a few things with little success. Ultimately, I would like to have the date and time in separate columns in the data frame.
The data frame looks something like this:
| ID | work_type | date |
|---|---|---|
| 1 | A | 1/3/2023 6:16am |
| 2 | B | 1/3/2023 6:20am |
| 3 | A | 1/4/2023 6:18am |
I need it to be separate and have the correct classes like the following
| ID | work_type | date | time |
|---|---|---|---|
| 1 | A | 1/3/2023 | 6:16am |
| 2 | B | 1/3/2023 | 6:20am |
| 3 | A | 1/4/2023 | 6:18am |
We could do
-output
If we want the classes to be modified
-output
data