Rather than focus on fixed time goals, it’s important that learning to develop software is an ongoing and continuous activity. You don’t ‘finish’ learning how to code, there is always something new to learn because the industry is still evolving, or tools, libraries and frameworks are always evolving. Trends also change. What’s the hot new frontend framework today may be replaced with something completely new 6 months from now.
It’s impossible to give a precise answer to ‘how long will it take me to learn language xyz’. Instead of thinking about a finite journey, you need to accept that a career in software development is a career of continuous and endless learning, and to keep your skills relevant and up to date you need to commit time and effort to your skills development.