if you're not going to bed until 2am it's a very bad idea to stop eating at 6 or 7pm. why you ask? because you're planning on going to bed eight hours after your last meal. if you were going to bed at 10pm and had issues sleeping and digesting at the same time, stopping at 6-7pm wouldn't be a bad plan. but assuming you get at least five hours of sleep that means that breakfast won't be til 7am. which would mean that, despite being awake for 19 hours a day you're not eating for 12-13 hours of the day. and if you sleep later, then that number goes higher. so if you are sleeping in until 10 am, you're trying to cram a whole day's worth of eating into 8 hours. if we were talking about the standard normal schedule person hours that would be the equivalent of someone who gets up at 6am and goes to bed at 10pm not eating after 2pm.
if you are one of the people who has issues sleeping and digesting, not eating for somewhere around 2-4 hours before bed is fine. but if you aren't going to bed until 2am, that cutoff time will be somewhere between 10pm and midnight.
yes, some people do have success curbing mindless munching by instating a "no food after x pm" rule. but again, 6pm to 2am is eight hours, or nearly a full workday. if you aren't spacing a meal in that timeframe somewhere, you should be having a substantial snack or two.
then you have to look at what you are eating. do your snacks have protein, fiber, carbs and fat? if they don't then you should start tweaking them so that they do. snacks should be like mini meals that contribute something to your diet, not twinkies. apples and nut butter, hummus and veggies, celery and cheese, fruit and cheese, a small [1/2 or 1/3 or 1/4] portion of what you would eat for a meal [like a bean based chili, vegetable soup, etc] are the things you want to be snacking on.
-google first. ask questions later.