What is a Day?
If you bothered to click on this article then I'm going to take for granted that you think I have an answer which is more complicated (better) than just the time it takes for the Earth to spin one revolution as the definition of a day. Well you're right. Let's delve in.
There are two main ways of defining a day for Earth (all of this applies to other orbiting masses, but I'm going to keep it about Earth to simplify the language) and they differ in a length. I think that solar days are the easiest to understand so I'm going to start there. If you pop a stick in the ground pointing straight up then it will cast a shadow. As the Earth rotates that shadow will be initially pointing vaguely westwards and as the sun rises then eventually the shadow will be pointing due North (or South depending on your Hemisphere of residence). The time at which this happens we define as noon. If we wait long enough, then after 24 hours and a bit, the shadow will be pointing in the same direction and we will have had a second noon. The period in between these we call one solar day, or one sol. This article was written after I watched The Martian and everyone kept using the word sol to refer to time so I had to look it up, but of course they were talking about sols on Mars instead which are a different length.
All of this makes sense; you can think of it as the time it takes to have the sun (which incidentally is also called Sol but that is a separate debate) to be in the same place in the sky. However, this is at a variable rate due to the fact that the Earth is not in a perfectly circular orbit around the sun. Instead we travel on a slightly eccentric orbit which means that the the time at which the sun is directly above you is non consistent. To get around this we break solar time into two categories, sundial and clock sols.
Clock sols are defined as a fixed 24 hours per day in an unchanging way in the same way as a clock would measure. Sundial sols measure the time between that hypothetical stick casting a North facing shadow and so vary throughout the orbit. We call the link between them the rather grandiose Equation of Time, graphed below:
As you can see, the length of a day differs throughout a year; but I don't mean in the same way as the length of daytime differing. Instead I mean day in the daytime plus nighttime sense. The tilt of the Earth is slightly to blame for this, but the eccentric orbit is the bigger factor.
So far we have covered the first year of day; now we will define sidereal days. Imagine you create a model solar system and you have it sat on your dining room table in front of you. It is all geared up so that all of the bodies spins at the correct rates relative to each other. When you look at Earth, you focus on one point on the equator and time how long it takes for it to be facing towards you again. This is the equivalent of asking: how long does it take the Earth to spin relative to the universe. Of course, this isn't a well defined concept; the universe has no fixed frame of reference, it is all relative. But we can have a sudo fixed reference frame by measuring based on distance stars which are mostly static relative to us.
This sidereal (before researching this article I thought it was sidereal as in looking at it from the side, but it actually comes from the Latin sidus from star) day is slightly shorter than a solar day and they come in at around 23 hours, 56 minutes and 4 seconds. Here is the diagram that solidified it for me:
So for solar days they have to spin one full turn plus a little big extra to get back to facing the sun. On planets which spin on their axis the opposite way relative to their motion around the sun, (Venus and Uranus) they have longer sidereal days than sols. Most planets have a lot of days relative to their years making their two types of days within a ratio of 0.997, but for the planets closer to the sun than Earth this the two types of day can differ massively. For Mercury, its sidereal day is about 2/3rds of its year, but its sols last three times longer.
So what is a day? Well, whichever of these many variations that you deem most useful. As usual with using everyday words for science we run into consistency problems, but for most practical purposes using sols will be what you probably wanted. Have a nice sol.