Low sensitivity and/or specificity of a diagnostic test for outcome results in biased estimates of the time to first event using product limit estimation. For example, if a test has low specificity, estimates of the cumulative distribution function (cdf) are biased towards time zero, while estimates of the cdf are biased away from time zero if a test has low sensitivity. In the context of discrete time survival analysis for infectious disease data, we develop self-consistent algorithms to obtain unbiased estimates of the time to first event when the sensitivity and/or specificity of the diagnostic test for the outcome is less than 100%. Two examples are presented. The first involves estimating time to first detection of HIV-1 infection in infants in a randomized clinical trial, and the second involves estimating time to first Neisseria gonorrhoeae infection in a cohort of Kenyan prostitutes.