Agree with other posters, it's a "wish," not a "command."
It's also a very popular social convention.
There are some tolerable substitutes. "Bless you," "Take care," "Be well." I had a probable ASD boss when I was waiting tables who HATED hearing me say "Have a nice day" 500 times during lunch service, so I learned to say, "Enjoy your meal."
These days, I mostly wait until I hear it to return it. "Have a great weekend." "I'll try. You do too."
I had a patch on my backpack in college. I loved it. It had a "straight face" with the caption "Have A Day."
_________________
"Alas, our dried voices when we whisper together are quiet and meaningless, as wind in dry grass, or rats' feet over broken glass in our dry cellar." --TS Eliot, "The Hollow Men"