Early universal access to antiretroviral treatment (ART) is critical in the control of the HIV epidemic. However, prompt initiation of ART remains problematic in China. This study analyzed the late testing and lag time between HIV diagnosis and initiation of ART from 2004 to 2016 and identified the risk factors for delayed initiation of ART. Data from 16,957 people living with HIV were abstracted from a hospital electronic health record database and a case report database for AIDS prevention and control in Yunnan province. Reasons for delayed initiation of ART were categorized into late testing, defined as CD4 count of < 350 cells/μL at baseline HIV diagnosis, and delayed access, defined as a lag time of > 1 month between the diagnosis and initiation of ART. Binary logistic regression models were used to identify risk factors for late testing and delayed access. The CD4 counts at diagnosis increased from 201 ± 147 cells/μL (mean ± SD) in 2004 to 324 ± 238 cells/μL in 2016 (p = 0.024). The CD4 count was higher for persons < 45 years, unmarried, and men who have sex with men (MSM) (356, 357, and 409 cells/μL, respectively) compared to their peers in 2016 (p < 0.05). The lag time from diagnosis to initiation of ART was significantly reduced from 59.2 months in 2004 to 0.9 months in 2016 (p < 0.05). The shorter lag time over the years was consistent when analysis was stratified by sex, age, marital status, and transmission routes, even though the lag time for people using drugs was longest in 2016 (> 2 months versus 0.82 and 0.72 month of heterosexuals and MSM, respectively). Compared to their peers, married persons (AOR = 0.63, 95%CI: 0.57, 0.69) were less likely to have delayed access to ART, and drugs-using patients (AOR = 3.58, 95%CI: 2.95,4.33) were more likely to have delayed access to ART. Late testing rather than delayed access to ART after a diagnosis remains problematic in China, although improvements have been seen for both parameters from 2004 to 2016. Our data highlight the importance of continued efforts to promote early diagnosis of HIV to prevent transmission, morbidity, and early mortality in HIV infection.