EA attenuates cognitive impairment in stroke rats by regulating endogenous melatonin secretion through synthesizing the aralkylamine N-acetyltransferase gene in the pineal gland. Here, AANAT is linked to Cognitive impairment.