[Stata] - Convert string to date


Who's got bright ideas to convert string variables to date variables?

For example in the dataset
"10Aug2000" formatted as a string variable.

How do I alter it to convert this to a data format??

Suggestions welcomed!


you first convert it into an integer:

gen date2 = date(date, "DMY")

then you convert it into a format that you can read:

format date2 %d

hope this helps! :)