Yes.
Anytime I get asked this I usually ask this question Imagine if you did not eat all day and then ate 1 meal at 9pm. Do you think you would gain weight?
There is only food that is helpful for losing weight and food that is not so helpful for losing weight.
Your body does not magically start storing all food after a certain time. What about people that work the night shift and have to eat at night? Or owls?
Do not eat after 6pm is as good as saying Do not eat for half the day and you will lose weight. Great throwaway tip to lose weight because then you probably will not eat for 13/14 hours but hardly sustainable.
After dinner is the number 1 time we want to eat! Typically speaking it is after work/when the kids have gone to bed/when you get a chance to sit down and relax.
My advice is to save some of your daily food intake for this time! It will make dieting easier, increase adherence to your food plan and will not hold you back whatsoever as long as your intake for the whole day is correct.