Urine tests can detect marijuana in the urine for approximately 3–30 days after use. Saliva tests can detect marijuana for approximately 24 hours after use. Some saliva tests have detected marijuana for up to 72 hours. Hair tests are the most sensitive tests, detecting THC for up to 90 days after use.
https://www.medicalnewstoday.com/articles/324315
Marijuana is not exempt from this process. For most, the body will excrete the drug completely within 30 days. That doesn’t necessarily mean someone will feel the effects of marijuana withdrawal that long though. In most cases, the discomfort of detox lasts only around three weeks at most, sometimes a little less.
https://www.mentalhelp.net/substance-abuse/marijuana/detox/
Though not as common as a urine test, in certain cases a person may be asked or required to take a blood test to detect marijuana. A blood test may point to marijuana use in a matter of minutes after a person uses the drug. However, some research shows that it may be detected for up to 25 days.
https://www.rehabcenter.net/marijuana/detection-time/
The effects of marijuana fade quickly, but the drug can be detected in the body for weeks and sometimes longer. The amount of time the active ingredients and breakdown products of weed remain in the system can range from a few hours to 90 days, depending on how often or how much marijuana the person has been using.
https://www.verywellmind.com/how-long-does-marijuana-stay-in-the-system-67791
doc for "marijuana detection time calculator".(Page 1 of about 14 results)