Hi everyone, I would like to ask some help in order to extract year from a string variable (year of incorporation) that is structured in this way: 12/9/1998.

I tried to encode the variable (year of incorporation), change the format in %td and then use the code year(year of incorporation) but Stata returns me a year that does not match with the one in the date. For example, for 12/9/1998 it returns 1970.

How can I solve the problem?

Thanks!