Robust date conversion from string to DateTime

I am having to convert dates in the following string format “24/9/2020” to DateTime format. DateTime does not deal with this basic format.

I have come up with the following solution that does this for the data I’m dealing with (all dates in this millennium), but I am sure there is batter way:

Reg.date_project_registered = replace.(Reg.date_project_registered,"/20"=>"-") #date format converions
Reg.date_project_registered = replace.(Reg.date_project_registered,"/"=>"-")
Reg.date_project_registered = DateTime.(Reg.date_project_registered)

Is there a better way?

Y-M-D date format is just the default. You can parse a DMY date format as explained in the docs (and I suppose to get out in same format too somehow):

julia> using Dates
julia> Date("24/9/2020", dateformat"d/m/y")
2020-09-24
1 Like