Conversion of literally written dates into date format
Am using STATA 16 on Windows.
I would like to convert
date
DEC-06-2018
11TH MAY 2019
23RD JANUARY 2018
into date format in STATA
I tried to 1s use
gen date2 = subinstr(date, "JANUARY", "JAN",.)
replace date2 = subinstr(date, "FEBRUARY", "FEB",.)
to shorten the months
but the 1st works but the second reverts JANUARY to JAN
and I have no clue as how to drop the TH or RD from 11th or 23rd respectively
Am using STATA 16 on Windows.
I would like to convert
date
DEC-06-2018
11TH MAY 2019
23RD JANUARY 2018
into date format in STATA
I tried to 1s use
gen date2 = subinstr(date, "JANUARY", "JAN",.)
replace date2 = subinstr(date, "FEBRUARY", "FEB",.)
to shorten the months
but the 1st works but the second reverts JANUARY to JAN
and I have no clue as how to drop the TH or RD from 11th or 23rd respectively
Comment