The ancient working people divided a day and night into twelve periods, and each period was called an hour. Twelve o'clock can refer to either a day or any time. Twelve o'clock was created by the ancient working people in China according to the natural laws of the sun, the changes of the sky and the daily production activities and living habits.
Pindan:
Before the sun came out from the horizon, the time before dawn was called "Pingdan", which is what we call dawn today. The earthly branch indicates that this time period is Yin Shi, that is, 3-5 am every day.
The "Qi of calming the gallbladder" in Mencius Gao Zishang is the earliest example of using the word "calming the gallbladder". "Qi" in this sentence means "clouds in the sky". Later, the word "Ping Dan" was also used in Historical Records and Biography of Li. Such as: "Ping Dan, Li Guang is its army." As for later poems, they are used more.
Baidu encyclopedia-twelve o'clock