Haven’t you always been taught that おはよう/おはようございます (ohayo/ohayo gozaimasu) means “Good morning” and こんにちは (konnichiwa) means “Hello” or “Good afternoon?”
Unless you’ve never taken Japanese class, chance is, you have been told that. But have you ever thought about at what point in time do you stop saying “ohayo,” and start saying “konnichiwa?” Is it 11am, is it 12noon?
The truth is, you can actually use “ohayo” regardless of the time. The term “ohayo” is written as お早う in kanji, where 早 means “early.” And traditionally, “ohayo” has been used to greet people who arrive early for their appointment, be it business or private.
So, it is perfectly fine to greet your night shift colleagues おはようございます (ohayo gozaimasu) at 11pm if they arrived early for their shift, and yes, Japanese people do use that.
As for こんにちは, I don’t really know much about it.