A headache on the second day after taking melatonin is considered to be caused by the patient’s intolerance to melatonin. Melatonin is a hormone that is secreted by the pineal gland in humans and mammals, and its main function is to brighten melanocytes, hence its name. In humans, melatonin is a sleep stimulant, enabling patients to sleep longer at night and to wake up less often, so that they are less likely to be awakened the next day. Melatonin has an anti-aging effect, but some people who take melatonin have headaches because their bodies can’t tolerate it.