Well when you eat a lot during the night, and then you go to bed, you're not burning any calories. So you could eat at 9pm and then work out for a little, but if you eat and then sleep, odds are you will gain weight.
It's not the time of day, but how long before bed. When you eat, the body takes time to break down the food. If you go to bed, the energy is not burned. Therefore it is stored. Some exceptions to this rule exist. Some people have really high metabolisms.
For the people saying this is fake--you are in fact the ones with no education on the matter. As someone said above, it's not the time of day, it's what time you go to sleep. Anytime you sleep within two hours of eating something, whether it be for 8 hours or just a nap, the food isn't being used for energy, seeing as when you sleep your body is expending the minimum amount of energy literally just to keep your body functioning. So if you are not active within two hours of eating (which is how long it takes food to digest from start to finish), it isn't being burned for energy but rather stored for later, as fat.