Why are there 24 hours in a day?

The question could be answered in a number of ways:

1. Historically (e.g. Egyptians did for <...> reasons)
2. Mathematically (It is a highly composite number)

I'm looking for a mathematical answer.

I've got a basic idea of this, but I want to understand any underlying theories, and I want to be more knowledgeable on this matter so as to be able to see similar patterns.

The idea I've used and been told of is:

The ratio of the number of factors of a number to the number itself gives us a good idea of how easily it can be used to count.

The number 12 definitely satisfied this criteria, at least in comparison to many of the numbers that come before it. Hence, there are 12 hours in half a day. It could easily be divided in 4 parts, so that one could do 4 different things, or it could be easily divided into 6 parts... etc.

Please give me further insight.

• Alas, the answer has nothing to do with mathematical properties of 24. It is an accident of history that was motivated by astronomical considerations more than mathematical ones. See Was there a very early culture that's number system was 12-based, like ours is 10-based? – Conifold Feb 21 at 20:56
• In addition to Conifold's comment, it may be of interest to note that the Egyptians' 24-hour day did not have fixed length hours. It was the Greeks you introduced fixed length hours in order to facilitate calculation. See, for example, this page on the Cornell site. – Nick R Feb 22 at 1:09
• But in practice, unequal hours persisted until the wide spread of clocks. The day and night, each were divided into equal hours. So day hours almost never were equal to night hours. – Alexandre Eremenko Feb 22 at 2:51
• Ha Ha the Astronomers will tell you there's only 23h56m in a day. (solar vs. sidereal). – Carl Witthoft Feb 22 at 12:59
• Quick: if it's 5 bells of the second watch, what landlubber time is it? :-) – Carl Witthoft Feb 22 at 12:59