How long does it take to transfer to a UC in 2015?

I did not do well in high school so I have to attend a community college. However, I am very determined to transfer out of community college into a UC. How long does it take to transfer out of a community college? I know that it used to be 2 years, but nowadays, it is apparently 3-4 years. The reason that I did not do well in high school was because I was terrible on taking tests. I was great at attendance and class/homework, however I nearly failed every single test. Apparently it’s due to undergoing stress that I could not do well on tests. So I was wondering how it will be in college and how long it will take me to transfer. Please answer~