A brief history of (coordinated universal) time
Coordinated universal time is what we usually refer to as UTC in software programming. Before we talk about UTC, we should know what is universal time.
Universal time is the date-time standard used worldwide. Before Universal Time, there was Greenwich Mean Time (GMT). GMT was created to solve the problem of lacking a standard time across a region or globe. For example, without a common time, one that travels across a country by train has to constantly adjust his watch to keep it up to date to local time.
Another major reason why GMT was established is that, during the Age of Discovery, there is a strong demand for a global time such that ships across the Atlantic Ocean can self navigate themselves. Hence, Solar noon on Greenwich London, English was created as the starting reference point of a global day. Anything to the west of it will add the proportional time of a day. By doing this, navigation can establish the correct longitude with a known latitude, thus exact location. This was a huge invention at the time and accelerated the expansion of the English Colonization process. GMT was still in use in many commonwealth countries today.
However, later, GMT was changed to measure a day starting from midnight due to the need for civil timekeeping. This makes GMT ambiguous. Then later, International Astronomical Union created a new standard call Universal Time based on GMT, it's now the standard we used across the world.
So UT is an extension of GMT with many improvements.
One of such improvements is accuracy.
On earth, the time we refer to is derived from earth rotation. i.e. one rotation is one day, 24 hours, or 86400 seconds.
How is a day measured? In ancient times, people use sundial which tracks the shadow of the sun. In recent centuries, astronomers adopted a more accurate way to measure a day. They observe the time taken for a distant star to return to the meridian line on earth. This is accurate because the moving stars we see on earth are caused exactly by earth rotation.
However, the rate of earth rotation is also affected by a few things. The tidal pull from the moon, the position of the earth in the elliptical orbit around the earth. This means the day measured is a varying value. This is still fine because on earth people only care about the sunrise and sunset. But to carry out scientific research, the variance of a second cannot be too big. We need a more deterministic way to represent the passage of time.
Here comes the atomic clock:
An atomic clock is a clock whose timekeeping mechanism is based on the interaction of electromagnetic radiation with the excited states of certain atoms. Specifically, either a hyperfine transition in the microwave or electron transition in the optical or ultraviolet region of the emission spectrum of an atom is used as a frequency standard for the timekeeping element. Atomic clocks are the most accurate time and frequency standards known and are used as primary standards for international time distribution services, to control the wave frequency of television broadcasts, and in global navigation satellite systems such as GPS.
In short, the atomic clock has defined the standard length of a second across the universe. So no matter where you are, one second will have the same length for you.
But how is this related to universal time? We want to have a unified time standard that satisfies the requirements of both being solar time and consistency of being a time unit.
Here comes Coordinated Universal Time or UTC. The key is "coordinated".
UTC is actually based on atomic time. One second in UTC is always equal to one second in the atomic clock. However, given that the atomic clock has a different second than it in UT, there need to be constant adjustments of UTC to make UTC compatible with UT. This adjustment is called leap second. The current number of leap seconds added to UTC is 37. Since researchers found that the earth rotation has become faster, there might be some deduction of leap second in the future.
Fun fact: It is not possible to compute the exact time interval elapsed between two UTC timestamps without consulting a table that shows how many leap seconds occurred during that interval.
Today UTC is mainly governed (coordinated) by the International Time Bureau located in Paris. Time is synchronized via Network Time Protocol across the world. Thus, all the electronic devices that humans use can now have a deterministic time reference.
One thing to take note of is that UTC is concerned with time. For the date, depends on the calendar standard we used, there are also leap years.
Gregorian Calendar is the most commonly used calendar system today that has a mean year of 365.2425 days. On the calendar, it uses 365 days a year, but to account for the .2425 day every day, the calendar system established a rule for leap year, where one day is added to February.
Likewise, Lunar Calendar has a different way to adjust leap year too.