I frequently invite people, usually strangers to have a nice day. Though I add the qualifier - I hope.." you have a nice day. I sincerely hope they do have a great day, and if it's not going so well, I add - "I hope it gets better, and tell them a particular quick joke that always brings a smile. Getting them to smile is the start of the day getting better for them.
With my kids, as they were growing up, occasionally, one of them would be sulking. I'd walk up to them and try to find out what was wrong. Often, even usually, it would be something inconsequential, and they were just in the mood to stew about it. I would say to them - Don't let me catch you smiling. Don't smile. Ah, I thought I caught you starting to smile. Don't you dare smile." By then they would burst out laughing, and the foul mood would be instantaneously gone. They would then complain that they hated that I could make them laugh so easily. But it would change their mood and allow them to have a good outlook for the remainder of the day.
I agree, if it is an insincere phrase - have a good day, that could be annoying. But when it is given from the heart, you almost can't help but be thankful that there are good people around who really care about others, to the point that they don't want to see someone having a bad day.
Usually, when a person can be made to smile, and they get rid of the bad mood that's taken over their day, they are thankful to have turned around their mood. I've even had people come back and thank me for making their day a bit brighter.
If we all tried to make each other's lives a little better, this world could be such a great place to live in.
That's from the POV of an eternal optimist, me.
Seeeeeeya; Chief Longwind of the North