If I eat and get diarrhea in less than an hour after eating, does my body still absorb the calories and nutrients from that meal? I have stomach bug

Infection? If the problem is due to infection, then it should be limited and you should be ok once the infection or the problem is cleared, if it is an ongoing problem, then you have to see your doctor to find out why.