The research whether the best time to drink milk is at night is inconclusive since human trials for this hasn't been yet observed or reported.
The functional foods promoting sleep in human beings are barley grass powder, whole grains, maca, panax, Lingzhi, asparagus powder, lettuce, cherry, kiwifruits, walnut, schisandra wine, and milk; Barley grass powder with higher GABA and calcium, as well as potassium. However, the sleep duration for modern humans is associated with food structure of ancient humans.
Tryptophan can increase the production of niacin, serotonin and melatonin. Tryptophan is not only a precursor of the neurotransmitter serotonin and the neurosecretory hormone melatonin for sleep/wake but it is also metabolized in the brain along different pathways to serotonin, melatonin and niacin and is partly used as a source of protein synthesis. The dietary tryptophan through the blood-brain barrier is favored by competing large neutral amino acids and carbohydrates; 5-hydroxytryptophan is converted to serotonin by aromatic L-amino acid decarboxylase and pyridoxine, however, serotonin is converted to melatonin by arylalkylamine-N-acetyltransferase and n-3 fatty acids.
The study by Milagres MP et. al 'Night milking adds value to cow's milk' in 2014 aimed to evaluate the melatonin concentration in milk collected by milking during the night and evaluating its effect, with or without tryptophan supplementation was done to measure the sleep quality of adult Wistar rats. The conclusion of the study was "Combining the techniques of night milking with tryptophan supplementation resulted in production of milk that improves sleep quality in rats."