The expression “have a good night” is widely used in everyday English as a farewell greeting. The phrase is used to convey good wishes for the latter part of the day or the nighttime to a friend, acquaintance or even a stranger.
The phrase can be used at any time during the evening or night. However, it makes more sense to use the greeting from 5:00 p.m. onward, because this is the time that most work days conclude, and thus the evening portion of the day has begun. But there are no hard-and-fast rules as to when the greeting should and should not be used.
The greeting can be used in a formal or informal context. Strangers often use the phrase when they come into contact in public places in the evening or nighttime. For instance, cashiers often use the phrase when addressing a customer, after they have paid for their goods and are about to leave the store. Others who work in the public sector also use the greeting a lot, such as hotel clerks, bank tellers and receptionists.
Using the greeting among friends and relatives is also common. It usually conveys more personal meaning when said to someone you know. For instance, if you have friends over for supper, you might say to them as they are leaving, “It was really nice having you over. I hope you have a good night.”
Another way of expressing the same sentiment would be to say, “I hope you have a good evening.”