Just spoke with a tour guide about this topic. If you lived in a city during the middle age in Europe, the night watch announced the current time every hour. How did they know the time? They just guessed, because nobody in the city could know better.
I grew up near train tracks and I can tell you that the ka-chunk ka-chunk ka-chunk of a train safely passing late at night became a soothing sound because it was so normal and happened around the same time every night.
I imagine they just made sure to hire people to yell the hour who had a musical and soothing voice.