Prilosec (omeprazole) has a relatively short 'half-life' when compared to most other medications.
The prescribing information for Prilosec reports a half-life around 0.5-1 hour, meaning it will be completely metabolized and eliminated from the body around 5 to 6 hours after your last dose (it generally takes 5-6 half-lives for a drug to be eliminated from the body).
What is interesting about Prilosec is that while the half-life is short, the effects of the drug can persist for up to 72 hours. The prescribing information touches on this point:
"Inhibition of secretion is about 50% of maximum at 24 hours and the duration of inhibition lasts up to 72 hours. The antisecretory effect thus lasts far longer than would be expected from the very short (less than one hour) plasma half-life, apparently due to prolonged binding to the parietal H+ /K+ ATPase enzyme. When the drug is discontinued, secretory activity returns gradually, over 3 to 5 days."
The main point is that while the drug will be eliminated from your body quickly, you can expect it to keep working for a few days after your last dose.
We have written several articles regarding drugs that can cause 'false-positives' on urine drug screenings, including ones concerning Prilosec and Zantac:
The situation you described in your question, having a false-positive drug screening, while uncommon, can certainly happen. It is important to let your doctor/drug screener know all the medications you take as many are well documented to cause problems.
If you believe your positive test result is because of a medication you are taking, it may be beneficial to ask if there are confirmatory screenings available to you, which are far more accurate than standard urinalysis tests. Be sure to see our article regarding this subject here:
Prilosec has a short half-life of 0.5-1 hour and therefore, is eliminated from the body relatively quickly (within one day). However, while Prilosec has a short half-life, the effects of the drug can last up to 3 days.