Hi all,
hope you can help me.
I have an Excel file with some date variables, listed in the format: dd-mm-yyyy. (ex. 01-07-2014 = 1st July 2014)
When I import the excel file into Stata (12.1), the formats look differently.
I started formatting the date variable like this:
gen new_date= date(old_date, "ddmmyyyy")
format new_date %td
after running this command, only some of the output looks like what I want (01July2014), but some of the variables are still listed as: 01-07-2014, and some are listed with a mm-dd-yyyy format, seperated with "/": 01/07/2014
At first, I was wondering if I had spaces infront of the dates in excel, so I tried to trim the data. However, this still doenst work.
Could it be that Stata automaticlly converts the date to american formats (mm/dd/yyyy).
Much appreciated with all your help!
Thanks in advance,
Malinna J.
hope you can help me.
I have an Excel file with some date variables, listed in the format: dd-mm-yyyy. (ex. 01-07-2014 = 1st July 2014)
When I import the excel file into Stata (12.1), the formats look differently.
I started formatting the date variable like this:
gen new_date= date(old_date, "ddmmyyyy")
format new_date %td
after running this command, only some of the output looks like what I want (01July2014), but some of the variables are still listed as: 01-07-2014, and some are listed with a mm-dd-yyyy format, seperated with "/": 01/07/2014
At first, I was wondering if I had spaces infront of the dates in excel, so I tried to trim the data. However, this still doenst work.
Could it be that Stata automaticlly converts the date to american formats (mm/dd/yyyy).
Much appreciated with all your help!
Thanks in advance,
Malinna J.
Comment