I guess I'm the third one to say it was during boot camp. Goddamn, I just plain FORGOT, and it was about two months into it that I had a hardon again sometime in my sleep.
The rumor was that they put saltpeter into the food to keep the recruits from getting aroused. But, I'll say that, for the most part, nobody was even thinking of doing it. When you get a chance to just sleep, you fuckin' sleep, and nothing's going to get in between you and some quality shuteye.
We had one whose grandfather passed away, and he was allowed to go home for a few days for the funeral and whatnot. The drill instructors joked that he'd "cook off early" and not last more than a minute when he got to spend time with his girl. When he returned, one of the first comments from the DI was, "You didn't last thirty seconds, did you?" He got a bashful grin and said, no sir! We all laughed for a second, and the DI told us to shut up and get back to work. Funny shit.