The key will be complete and open honesty about the use as above. The programs you are interested in are looking for habitual and chronic use. Not somebody who made a mistake and learned from it.
True, but to be safe let's cover all the bases...
Jello admits to having tried the stuff two years ago and having learned from it. Perfect. If he's honest he'll have no problems.
However, the more recent the use, the less impressive the claim that one has learned. If I used it last week and realized "it was a mistake", it carries less weight than years between the present and the last use.
Also, while the programs are definitely looking for habitual/chronic use (and perhaps how recently), it must be stressed that if it is found in your system JUST ONCE after you are in uniform, YOU WILL BE GONE.
I served on the review board for a guy who popped positive, and processed several others. They were all enlistedmen. NONE survived. If they won't tolerate it among junior sailors, just imagine how they will treat a Mid/Cadet/Officer.
I saw many fellow Mids be stupid and think they could get away with it. They didn't.
The services are serious about drugs. I remember the crash and fire aboard the USS NIMITZ back in the early 80's, when the investigation revealed a bunch of guys on the flight deck had been doing drugs. IIRC, it even extended to a few in the airwing. Heads rolled after that, and it's been like that ever since. You can't lead men in battle or in dangerous environments such as flight ops, UNREPs, or submarine ops if you're stoned.