Hello Statalist,

I am having trouble converting dates. I have three date variables (daily_case_date, mandate_order_date, and first_public_healthpost.
I am using the correct code
HTML Code:
gen daily_case_date1=date(daily_case_date, "DMY")
, but when I run the code, I get a new variable with missing values generated.
They are all currently string variables so I don't believe I need to run the tostring code beforehand.

I'm providing a clip so you can see the issue below, any assistance would be appreciated.

Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input str9 daily_case_date long(confirmed deaths) str20 state str2 stateabbeviation byte(demgov stateorder) str8(mandate_order_date first_public_healthpost)
"22-Jan-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"23-Jan-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"24-Jan-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"25-Jan-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"26-Jan-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"27-Jan-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"28-Jan-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"29-Jan-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"30-Jan-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"31-Jan-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"1-Feb-20"  0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"2-Feb-20"  0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"3-Feb-20"  0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"4-Feb-20"  0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"5-Feb-20"  0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"6-Feb-20"  0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"7-Feb-20"  0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"8-Feb-20"  0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"9-Feb-20"  0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"10-Feb-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"11-Feb-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"12-Feb-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"13-Feb-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"14-Feb-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
"15-Feb-20" 0 0 "Alabama" "AL" 0 1 "7/16/20" "7/16/20"
end
------------------ copy up to and including the previous line ------------------

Listed 25 out of 25398 observations