Despite considerable advances in the past few years, obesity and type 2 diabetes mellitus (T2DM) remain two major challenges for public health systems globally. In the past 9 years, genome-wide association studies (GWAS) have established a major role for genetic variation within the MTNR1B locus in regulating fasting plasma levels of glucose and in affecting the risk of T2DM. This discovery generated a major interest in the melatonergic system, in particular the melatonin MT2 receptor (which is encoded by MTNR1B). In this Review, we discuss the effect of melatonin and its receptors on glucose homeostasis, obesity and T2DM. Preclinical and clinical post-GWAS evidence of frequent and rare variants of the MTNR1B locus confirmed its importance in regulating glucose homeostasis and T2DM risk with minor effects on obesity. However, these studies did not solve the question of whether melatonin is beneficial or detrimental, an issue that will be discussed in the context of the peculiarities of the melatonergic system. Melatonin receptors might have therapeutic potential as they belong to the highly druggable G protein-coupled receptor superfamily. Clarifying the precise role of melatonin and its receptors on glucose homeostasis is urgent, as melatonin is widely used for other indications, either as a prescribed medication or as a supplement without medical prescription, in many countries in Europe and in the USA.