The FAA has exact standards for each class of drug, and I guarantee it's longer than 8 hours for a narcotic
These guys have some good info:
http://aviationmedicine.com/
To be 100% safe call your AME, he knows for sure.
And don't push the limits...Keep in mind that even after the FAA waiting period you can still test positive for days or weeks afterwards. The drug test may detect both "under-the-influence" levels as well as residual levels from past use. If you have residual levels you will be asked to show that you had a prescription. I'm not sure what would happen if a pilot had higher levels from a prescription, but I wouldn't want to find out.