The length of time it takes cannabis to leave your body's system depends upon your body type, and how frequently and heavily you have used cannabis in the past.
Another thing to consider is how you are being tested for cannabis use, as some tests are better than others when it comes to long-term detection in the body after cessation of use.
How to get weed out of your system
Due to the chemical structure of the active component of cannabis (known as cannabinoids) being easily dissolved in fat, cannabis can stay in the body for up to ten days for an infrequent or light user, providing they are in decent physical shape.
Methods of Testing for Cannabis
As far as urine testing is concerned, cannabis can't be detected much beyond five days to a week; in most cases, it can't be detected at all beyond two days.
Thirty days is considered the absolute maxim and then only for an obese and very heavy user of the drug.
Hair testing is more sensitive to cannabis, and can detect use of the drug within a window of around three months prior to the test. For blood tests, the figure is around two weeks, although this type of test is less commonly administered. This short film explains further: