I've been trying to figure out how to mass change the date formatting of my data (as there are millions of data on the dataset) using Jupyter Notebook as the two datasets given to me has a different date format. Tried to google for codes on how to change the date format but hasn't been successful. For example, I would like to change the date formatting for "Discharged" and the initial dataset after merging to a dataframe and the desired output would look something like this
Dataset (Merged using Dataframe)
| ID | Age | Date Seen | Date Discharged |
|---|---|---|---|
| 001 | 21 | 2019-10-22 | 02-02-2022 08:00:00PM |
| 002 | 18 | 2013-05-24 | 15-05-2019 06:30:00PM |
Desired Output
| ID | Age | Date Seen | Date Discharged | Calculated Years (Round Up) |
|---|---|---|---|---|
| 001 | 21 | 2019-10-22 | 2022-02-02 | 3 |
| 002 | 18 | 2013-05-24 | 2019-05-15 | 6 |