Hitsuga
No, that's a myth. All calories get turned into sugars, and any surplus calories are stored as fat. If you're not eating at a surplus of calories, you won't gain fat. I mean, how is your body even supposed to tell that it's past 7pm?
Generally speaking, calories are stored as what they are. Protein is stored as structures (such as your muscle and organ tissues), carbohydrate is stored as glycogen, and fat is stored as fat. Unless you've been chowing down on like 600 - 800 grams (depending on bodyweight, activity level, blah blah blah), for several days on end, before anything turns into fat. De novo lipogenesis is a very rare phenomenon. After the storage is when the body generally begins to access it for it's needs. For example, when eating carbohydrate, they get broken down into simpler sugars, get shuttled off via insulin and stored. Once blood sugar gets too low, the body will then release glucagon, accessing glycogen and starting the process of glycogen being converted into glucose for the body to access.
Hitsuga
Your metabolism doesn't slow down before bed! Any surplus in calories would get stored whether you ate it at night or during the day. I mean seriously, if anything, our bodies are LESS likely to store fat at night because we aren't eating anything while we sleep. It's going to burn off any calories you eat just keeping you alive! A perfectly sedentary person burns well over 1000 calories just living. If you laid in bed all day, you would still burn a lot!
It WILL go down during sleep, simply because there isn't a lot of real movement going on. Even someone who is bed-bound is likely to still move around some. It may not be a whole lot, but you're still like... moving. Unless you're prone to violently tossing and turning, or sleep-walking, your energy expenditure during sleep is not going to be very awesome.
I believe it's more accurate to say that the metabolism is just the process of the body using energy to do what it has to do, from creating hormones to pumping blood. The body is constantly using energy, sending various ratios of glucose and fat through the body to be used as directed. (Generally speaking, when performing low-level activity, the body prioritizes fat over glucose, and in high activity, the body uses glucose, and then eventually shifts into utilizing fat to avoid burning through all of your glycogen stores. However, due to circumstances of our energy expenditure, those short bursts of activity burn more fat anyway, so not necessarily an excuse to stay sedentary either.
razz But the irony that people who spend an hour on the treadmill would get far more done if they did a bit of sprinting instead, but I digress.) It is just that during our waking hours, we are more active (even the sedentary amongst us), so the rate at which we use energy is greater.
In any case, to the OP, provided proper calories and activity, you shouldn't have anything to fear from eating before bed. It's not the night-time eating that made you gain weight, it was either excess calories, water being stored via glycogen repletion, or a ton of other factors entirely. If you sleep soundly.