Here the authors build a melatonin-based circadian biomarker-driven gene switch in mammalian cells for type-2 diabetes treatment by oscillatory GLP-1 release. This evidence concerns the gene GCG and type 2 diabetes mellitus.