Valium / Xanax / Benzos - up to 30 days
Ambien, et al - up to 30 days
Heroin / most opiates - 4 days (peak effect at ~48 hours)
Cocaine - 2 days (not medically recognized as a physical "withdrawal")
Alcohol - initially 2 days with potential for PAWS (post acute withdrawal syndrome) for 1 month
Marijuana - no physical withdrawal
Also, remember de-tox does not equal positive drug test. One can still test positive for a substance (e.g., marijuana) and not be going through de-tox per se.