PrefaceGreenwich Mean Time, World Time, Zulu Time, GMT, UTC, cross-time zone, daylight saving time, these dazzling time terms may all be familiar to us, but when we really encounter a problem, we may not be so sure and have to check it again, and after dealing with it, we may forget it after a while. Today, we will go through them thoroughly. 1. GMTWhat is GMTGMT (Greenwich Mean Time), Greenwich Mean Time (also known as Greenwich Mean Time). It stipulates that the time when the sun passes through the Royal Greenwich Observatory on the outskirts of London, England every day is 12 noon. History of GMTThe Royal Observatory Greenwich began conducting celestial observations in the 17th century as part of its expansion plan for maritime hegemony. For astronomical observations, a longitude line passing through the center of the meridian at the Greenwich Observatory in London, England was chosen as the zero degree reference line. This line is referred to as the Greenwich meridian. In October 1884, an International Meridian Conference was held in Washington, USA, which set the Greenwich Meridian as the prime meridian and Greenwich Mean Time (GMT) as the world time standard (UT, Universal Time). This also determines the division of the world's 24-hour natural time zones, and all time zones are based on the offset from GMT. Until 1972, Greenwich Mean Time (GMT) was the world's standard for time. After 1972, GMT ceased to be a time standard. 2. UTCWhat is UTCUTC (Coodinated Universal Time), Coordinated Universal Time, is also known as World Unified Time, World Standard Time, and International Coordinated Time. Since the abbreviations in English (CUT) and French (TUC) are different, as a compromise, it is abbreviated as UTC. UTC is now the global time standard, and all parts of the world agree to synchronize their respective times. UTC time is a combination of the mean solar time (based on Greenwich Mean Time GMT), the new time scale corrected for the motion of the earth's axis, and the international atomic time in seconds. In the military, "Z" is used to represent Coordinated Universal Time. Since Z is used as a synonym for "Zulu" in radio communications, Coordinated Universal Time is also called "Zulu time". UTC consists of two parts:Atomic Time (TAI, International Atomic Time): The time obtained by combining all 400 atomic clocks in the world determines the speed at which time flows on each of our clocks. Universal Time (UT): Also called astronomical time, or solar time, it is based on the Earth's rotation, and we use it to determine how many atomic hours correspond to the length of one Earth day. History of UTCIn 1960, the International Radio Consultative Committee standardized the concept of UTC and put it into practical use the following year. The name "Coordinated Universal Time" was not officially adopted until 1967. Before 1967, UTC was adjusted several times due to the use of leap seconds to align UTC with the time of the Earth's rotation. 3. GMT vs UTCGMT is the former world standard time, and UTC is the current world standard time. UTC is more accurate than GMT, using atomic time to adapt to the precise timekeeping of modern society. However, when accuracy to the second is not required, the two can be considered equivalent. Every year, the Greenwich Observatory issues time information based on UTC. 4. Time ZoneWith the development of railways and other means of transportation and communication, as well as the promotion of global trade, the use of local solar time in different places brought about the problem of inconsistent time. In the 19th century, there was a need for a unified time standard, and time zones were born. How are time zones defined?Starting from the Greenwich prime meridian, a time zone is divided for every 15° of longitude east or west. Within this area, everyone uses the same standard time. But in reality, in order to take into account administrative convenience, a country or a province is often grouped together. Therefore, time zones are not strictly divided according to the north-south straight line, but are divided according to natural conditions. In addition: At present, there is no international organization that approves countries to change their time zones. Some countries change their time zones for specific reasons. The world is divided into 24 standard time zones, and the time difference between adjacent time zones is one hour. In different regions, the same time zone often has many different time zone names, because the name usually contains geographical information of that region of the country. During daylight saving time, the local time zone name and abbreviation will change (usually including the word "daylight" or "summer"). For example, the Eastern Standard Time in the United States is called EST, Eastern Standard Time, and the Eastern Daylight Time is called EDT, Eastern Daylight Time. To view the names of all time zones in the world, visit this website: https://www.timeanddate.com/t... 5. Daylight Saving TimeWhat is Daylight Saving TimeDST (Daylight Saving Time), daylight saving time is also called summer time or daylight saving time. It is a system of artificially setting local time in order to save energy. Generally, in the summer when the sun rises early, people advance the time by one hour, which allows them to get up and go to bed early, reduce the amount of lighting, and make full use of light resources, thus saving electricity for lighting. About 40% of the world's countries use daylight saving time in the summer, while the rest of the world uses standard time all year round. Standard time is therefore also called winter time in some countries. In countries that implement daylight saving time, there is one day in a year with only 23 hours (the day when daylight saving time starts), one day with 25 hours (the day when daylight saving time ends), and all other days are 24 hours. The green part represents the countries and regions that implement winter and summer time around the world as counted in 2019. History of Daylight Saving TimeIn 1784, Benjamin Franklin, the American ambassador to France, proposed the "daylight saving time system". In 1908, British architect William Willett proposed it again, but the proposal was not adopted at that time. In 1916, during World War I, the German government ordered clocks to be moved forward one hour to save coal needed for the war effort by gaining an extra hour of daylight, becoming the first country to implement daylight saving time. Subsequently, the four countries involved in World War I, Britain, France, Russia and the United States, followed suit. The United States canceled daylight saving time in 1919 after the end of World War I, but restarted it during World War II in 1942, and in 1966 formal legislation was enacted to ensure its permanent use. During the oil crisis from 1973 to 1975, the United States extended daylight saving time for two consecutive years to save oil. Most European countries began to implement daylight saving time in 1976, three years after the fourth Middle East war led to the first oil crisis (1973). In April 1986, the General Office of the State Council of China issued the "Notice on the Implementation of Daylight Saving Time Nationwide", requiring all people to go to bed early and get up early to save energy: at 2 o'clock on the first Sunday in mid-April every year, the clocks will be set forward one hour; at 2 o'clock on the first Sunday in mid-October, the clocks will be set back one hour. However, this daylight saving time was only implemented for 6 years and was discontinued in 1992. The main reason was that China has a vast east-west region but only follows Beijing time. Real-time daylight saving time brought many unrealistic adverse effects. Daylight Saving Time ControversyOver the past 100 years, daylight saving time has tended to be favored only in times of severe national crisis, such as war and energy shortages. However, during the past decade of relative peace, this time system has become increasingly unpopular. It will disrupt people's biological clocks and often cause them to lack sleep, which is not only harmful to human health and cause car accidents, but also causes great chaos in the tourism and aviation sectors. In addition, whether winter and summer time can actually save energy remains to be discussed. A US study conducted as of March 2014 showed that this time conversion system could help the US reduce electricity consumption by 1% in March and April at most, while the US National Bureau of Standards believes that daylight saving time has no effect on electricity consumption. In Russia, a previous report also showed that the amount of electricity that daylight saving time helps Russia save each year is only equivalent to the power generation of two or three thermal power plants, which is very "useless". On March 26 last year (2019), Germany, as the first country in the world to propose and implement daylight saving time, passed a proposal to cancel the winter and summer time conversion system with 410 votes to 192 in the European Parliament. It is planned that from April 2021, all EU countries will no longer implement the winter and summer time conversion system. Once the member states reach a final bill, they will choose to use summer time or winter time permanently. 6. Local TimeThe time used in daily life is usually called local time. This time is equal to the local time in the time zone we are in (or use), which is defined by the offset from Coordinated Universal Time (UTC). This offset can be expressed as UTC- or UTC+, followed by the number of hours and minutes of the offset. 7. Date in JavaScriptGet the local time and print new Date() in different time zones. The output will be different: new Date(); Get the number of milliseconds between local time and midnight, January 1, 1970 (GMT): new Date().getTime(); Returns the difference between local time and GMT in minutes: new Date().getTimezoneOffset(); How to display the local time correctly anywhere (as long as you know the timezone of that place): //Target table time, East 8th zone let timezone = 8; //Get the time difference between local time and Greenwich Mean Time (note that it is in minutes, remember to convert) const diff = new Date().getTimezoneOffset(); //Get Greenwich Mean Time based on local time and time difference const absTime = new Date().getTime() + diff * 60 * 1000; //According to Greenwich Mean Time and local time zones, get the time in each time zone let localTime = new Date(absTime + timeZone * 60 * 60 * 1000); //Handle daylight saving time (isDST is its own encapsulated processing method) if(isDST(localTime, country)) { localTime = new Date(absTime + (timeZone + 1) * 60 * 60 * 1000); } return localTime; The above is the detailed content of JS thoroughly understanding GMT and UTC time zones. For more information about JS, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: How to install MySQL under Linux (yum and source code compilation)
>>: How to implement nginx smooth restart
This article mainly introduces the process analys...
Copy code The code is as follows: <!DOCTYPE ht...
Edit /etc/docker/daemon.json and add the followin...
title: vue uses vue-meta-info to set the title an...
background We can use react-color to implement th...
This article records the graphic tutorial of MySQ...
1: If you use the tag <a> to link to a page,...
Nowadays, application development is basically se...
This article takes Centos7.6 system and Oracle11g...
Table of contents Introduction Description Naming...
Documentation: https://github.com/hilongjw/vue-la...
HTML consists of two parts: head and body ** The ...
Table of contents Overview 1. Compositon API 1. W...
The operating system for the following content is...
This article example shares the specific code of ...