Melatonin-based photoperiod time-measurement and circannual rhythm generation are long-term time-keeping systems used to regulate seasonal cycles in physiology and behaviour in a wide range of mammals including man. We summarise recent evidence that temporal, melatonin-controlled expression of clock genes in specific calendar cells may provide a molecular mechanism for long-term timing. The agranular secretory cells of the pars tuberalis (PT) of the pituitary gland provide a model cell-type because they express a high density of melatonin (mt1) receptors and are implicated in photoperiod/circannual regulation of prolactin secretion and the associated seasonal biological responses. Studies of seasonal breeding hamsters and sheep indicate that circadian clock gene expression in the PT is modulated by photoperiod via the melatonin signal. In the Syrian and Siberian hamster PT, the high amplitude Per1 rhythm associated with dawn is suppressed under short photoperiods, an effect that is mimicked by melatonin treatment. More extensive studies in sheep show that many clock genes (e.g. Bmal1, Clock, Per1, Per2, Cry1 and Cry2) are expressed in the PT, and their expression oscillates through the 24-h light/darkness cycle in a temporal sequence distinct from that in the hypothalamic suprachiasmatic nucleus (central circadian pacemaker). Activation of Per1 occurs in the early light phase (dawn), while activation of Cry1 occurs in the dark phase (dusk), thus photoperiod-induced changes in the relative phase of Per and Cry gene expression acting through PER/CRY protein/protein interaction provide a potential mechanism for decoding the melatonin signal and generating a long-term photoperiodic response. The current challenge is to identify other calendar cells in the central nervous system regulating long-term cycles in reproduction, body weight and other seasonal characteristics and to establish whether clock genes provide a conserved molecular mechanism for long-term timekeeping.