Much of our current understanding of how circadian rhythms are generated is based on work done with Drosophila melanogaster. Molecular mechanisms used to assemble an endogenous clock in this organism are now known to underlie circadian rhythms in many other species, including mammals. The genetic amenability of Drosophila has led to the identification of some genes that encode components of the clock (so-called clock genes) and others that either link the clock to the environment or act downstream of it. The clock provides time-of-day cues by regulating levels of specific gene products such that they oscillate with a circadian rhythm. The mechanisms that synchronize these oscillations to light are understood to some extent. However, there are still large gaps in our knowledge, in particular with respect to the mechanisms used by the clock to control overt rhythms. It has, however, become clear that in addition to the brain clock, autonomous or semi-autonomous clocks occur in peripheral tissues where they confer circadian regulation on specific functions.