Hydraulic detention time (HDT), also called hydraulic retention time (HRT) or residence time, is a fundamental parameter in environmental engineering that measures the average time wastewater spends in a treatment unit. It determines treatment efficiency by ensuring sufficient contact time for physical, chemical, and biological processes to occur. Detention time directly affects settling of solids, biological degradation of organics, and pathogen removal. The theoretical calculation assumes ideal plug flow conditions, though real systems often include baffles and mixing to approach this ideal and prevent short-circuiting.