It takes about 30 minutes to determine if a person is infected with HIV. However, it takes 2 to 4 weeks from the time of infection for antigen tests to detect the presence of HIV and up to 6 months for standard tests to detect antibodies, according to WebMD.
HIV testing is carried out on a small sample of blood, although some tests can detect antibodies in saliva or other body fluids.
WebMD advises people who are at risk of HIV infection to go for testing. They include those with multiple sexual partners, users of injected drugs who share needles, those who have had STDs and those who engage in sex with people who are infected or are likely to be infected with HIV.