It's always going to take a few years.
The global fleet is about 2 billion passenger and commercial vehicles, and the global yearly production is about 100 million. So even if all new cars sold from now are electric, it will take 20 years.
But who knows what kind of autonomous vehicles and other innovations we'll have in 20 years. Buckle up :)