Short-wavelength light guides many behaviors that are crucial for an insect's survival. In Drosophila melanogaster, short-wavelength light induces both attraction and avoidance behaviors. How light cues evoke two opposite valences of behavioral responses remains unclear. Here, we comprehensively examine the effects of (1) light intensity, (2) timing of light (duration of exposure, circadian time of day), and (3) phototransduction mechanisms processing light information that determine avoidance versus attraction behavior assayed at high spatiotemporal resolution in Drosophila. External opsin-based photoreceptors signal for attraction behavior in response to low-intensity ultraviolet (UV) light. In contrast, the cell-autonomous neuronal photoreceptors, CRYPTOCHROME (CRY) and RHODOPSIN 7 (RH7), signal avoidance responses to high-intensity UV light. In addition to binary attraction versus avoidance behavioral responses to UV light, flies show distinct clock-dependent spatial preference within a light environment coded by different light input channels.