I remember having a blip about halfway through my second year, near the time you mention - I was basically doing too much (additional paid jobs, trying to prepare for conferences, preparing for my wedding, being academic course rep, etc). I shed several activities and got married, and for a while rode on a crest of being a Mrs.
However my worst point I think came in my third year, about month 30, I became clinically depressed and had no confidence. I didn't know where I was going with my thesis and ended up breaking down and having several weeks off. It helped, I saw my doctor and have now recently completed my PhD.
I think the overall message is try not to give up at all if you can - I was so close, so very close, but am now so glad that I didn't.