I will assume monthly compound interest.
Then:
yearly interest: 12%
monthly interest = (3/12) %
invested money: C
Final money: 2C
n: number of months
Compund interest formula:
Final money = Invested money * (1 + 0.03/12)^n
2C = C * (1.0025)^n
2C/C = (1.0025)^n
2 = (1.0025)^n
n = log(2) / log (1.0025)
n = 277.6 months
Time = 278 months = 23.1 years