Scope: Prebiotics exert anxiolytic and antidepressant effects through the microbiota-gut-brain axis in animal models. However, the influence of prebiotic administration time and dietary pattern on stress-induced anxiety and depression is unclear. In this study, whether administration time can modify the effect of inulin on mental disorders within normal and high-fat diets are investigated. Methods and results: Mice subjected to chronic unpredicted mild stress (CUMS) are administered with inulin in the morning (7:30-8:00 am) or evening (7:30-8:00 pm) for 12 weeks. Behavior, intestinal microbiome, cecal short-chain fatty acids, neuroinflammatory responses, and neurotransmitters are measured. A high-fat diet aggravated neuroinflammation and is more likely to induce anxiety and depression-like behavior (p < 0.05). Morning inulin treatment improves the exploratory behavior and sucrose preference better (p < 0.05). Both inulin treatments decrease the neuroinflammatory response (p < 0.05), with a more evident trend for the evening administration. Furthermore, morning administration tends to affect the brain-derived neurotrophic factor and neurotransmitters. Conclusion: Administration time and dietary patterns seem to modify the effect of inulin on anxiety and depression. These results provide a basis for assessing the interaction of administration time and dietary patterns, providing guidance for the precise regulation of dietary prebiotics in neuropsychiatric disorders.