New York TImes: During the day, the brain’s pea-sized pineal gland remains inactive. A few hours before our natural sleep time, as it starts to get dark outside and the light entering our retina fades, the gland switches on to flood the brain with melatonin.

“Melatonin is sometimes called the ‘hormone of darkness’ or ‘vampire hormone,’” because it comes out at night, said Matthew Walker, a professor of neuroscience and psychology at the University of California, Berkeley, and the author of the book “Why We Sleep.” As levels of melatonin rise, levels of cortisol, the stress hormone, fall. Respiration slows. Soon, our eyelids begin to droop.

Instead of a lights-out trigger, melatonin acts more like a dimmer switch, turning the day functions off and switching night functions on. So taking a melatonin supplement is sort of like taking a dose of sunset, tricking your body into feeling like it’s nighttime. It doesn’t put you to sleep as much as it tells the body that it’s time to sleep.

“It may take several hours,” said Dr. Ilene M. Rosen, a sleep medicine doctor and associate professor of medicine at the Perelman School of Medicine at the University of Pennsylvania, “which is what I think is the misconception about how melatonin is used.”

Melatonin may make you feel a little drowsier when you take it, but it has a bigger impact on regulating the timing of your overall sleep-wake cycle and helping to set the circadian clock, the roughly 24-hour internal timekeeper that tells your body what time of day it is and syncs it with the outside world.

Get the full story at nytimes.com.