Theoretical and empirical studies of habitat selection suggest that reptiles should use "fixed" structural Features (perch diameter, vegetation) or light intensity (sun and shade) to select thermally suitable microhabitats. But how do nocturnal species select thermally suitable diurnal retreat sites at night in the absence of visual cues? To investigate this question, we studied habitat selection by two sympatric nocturnal snakes, the endangered Broad-Headed Snake Hoplocephalus bungaroides and the common Small-Eyed Snake Cryptophis nigrescens. In the field, we investigated whether snakes selected diurnal retreat sites nonrandomly with respect to vegetation structure and rock temperature. In the laboratory, we offered snakes a choice between rocks with different crevice sizes, temperatures, and degree of shading. In the field, rocks used by snakes received significantly higher levels of incident radiation intensity (and therefore had higher temperatures) than random rocks but had similar levels of canopy cover. This apparent paradox reflects differences in the position of canopy gaps relative to the path of the sun, the most important determinant of a rock's diurnal temperature profile. In the laboratory, snakes chose rocks with narrow crevices but did not discriminate between shaded and exposed rocks. Snakes consistently chose hot rocks over cold rocks, even though the nocturnal temperature difference between the two retreat sites was less than 4 C. Our results show that these nocturnal snakes use a fixed structural cue (crevice size) to select potential retreat sites but then use a temporally variable cue (substrate temperature) to choose among potential retreat sites.