SoFunction
Updated on 2025-04-10

JS thoroughly understands GMT and UTC time zones

Preface

Greenwich Time, Universal Time, Zulu Time, GMT, UTC, cross-time zone, and daylight saving time, these dazzling time terms may be familiar with, but when we really encounter problems, we may not be so sure, so we have to check it out again. After processing, it may be forgotten again. Today, let’s sort them out thoroughly.

1. GMT

What is GMT

GMT (Greenwich Mean Time), Greenwich Normal (also known as Greenwich Time).

It stipulates that the sun passes through the Royal Greenwich Observatory in the suburbs of London, England at 12 noon every day.

History of GMT

In order to expand maritime hegemony, the Royal Observatory of Greenwich began to conduct celestial observations in the seventeenth century. For astronomical observation, a meridian line passing through the center of the meridian meter of the Greenwich Observatory in London, England was selected as the zero-degree reference line. This line, referred to as the Greenwich Meridian for short.

An international meridian conference was held in Washington, USA in October 1884. The conference set the Greenwich meanon as the prime meridian and used the Greenwich Mean Time as the world time standard (UT, Universal Time). This also determines the division of the global 24-hour natural time zones, and all time zones are referenced by the offset between them and GMT.

Before 1972, Greenwich Time (GMT) was the standard for world time. After 1972, GMT is no longer a time standard.

2. UTC

What is UTC

UTC (Coodinated Universal Time), is also known as the world unified time, world standard time, and international coordinated time. Because the abbreviation of English (CUT) and French (TUC) is different, it is referred to as UTC as a compromise.

UTC is now a globally common time standard, and localities around the world have agreed to coordinate their respective time periods simultaneously. UTC time is a comprehensive actuation of the average solar time (based on GMT of Greenwich time), a new time scale corrected by the earth axis movement, and an international atomic time in seconds.

In the military, the world is coordinated using "Z" to represent it. Since Z uses "Zulu" as a synonym for radio contact, it is also called "Zulu time" when coordinating the world.

UTC consists of two parts:

Atomic time (TAI, International Atomic Time):

Combining the time obtained by all 400 atomic clocks around the world, it determines the speed at which time flows in each of us.

Universal Time (UT, Universal Time):

Also known as astronomical time, or the sun's time, its basis is the rotation of the earth. We use it to determine how many atoms, which corresponds to the length of time of an Earth day.

The History of UTC

In 1960, the International Radio Advisory Committee standardized and unified the concept of UTC and put it into practical use the following year.

The name "Coordinated Universal Time" was not officially adopted in 1967.

Before 1967, UTC was adjusted several times because it was necessary to use leap second to unify UTC with the earth's rotation time.

3. GMT vs UTC

GMT is the pre-world standard, and UTC is the present world standard.

UTC is more accurate than GMT, and it uses atomic time to adapt to the precise timing of modern society.

But without the need to be accurate to seconds, the two can be considered equivalent.

The Greenwich Observatory will issue information every year, based on UTC.

4. Time zone

With the development of trains and railways with other transportation and communication tools, and the promotion of global trade, the use of their respective local solar time has brought about the problem of inconsistent time, which gave rise to the need for unified time standards in the 19th century, and time zones were born.

How is the time zone defined

From the Greenwich Primordial Meridian, each time interval between the longitudes is 15° east or west, and everyone uses the same standard time in this area.

But in fact, in order to take into account administrative convenience, one country or one province is often classified together. Therefore, the time zone is not strictly divided by the north-south straight line, but is divided by natural conditions. In addition: At present, there is no international agency that approves the time zone change of countries. Some countries will change their time zones for specific reasons.

The world is divided into 24 standard time zones, with the time difference between adjacent time zones one hour.

In different regions, the same time zone often has many different time zone names, because the name usually contains geographical information for the country and the region. During daylight saving time, the local time zone name and abbreviation will change (usually include the words "daylight" or "summer").

For example, the Eastern Standard Time is called: EST, Eastern Standard Time; and the Eastern Daylight Time is called: EDT, Estern Daylight Time.

If you want to view the names of all time zones in the world, you can visit this website: /t...

5. Summer time

What is daylight saving time

DST (Daylight Saving Time), also known as summer time, or daylight saving time.

It is a system that artificially stipulates local time to save energy. Generally, in the early summer, artificial time is advanced by one hour, which can make people get up early and go to bed early, reduce the amount of lighting, and make full use of lighting resources, thereby saving lighting electricity.

About 40% of countries around the world use summer time, while others use standard time only throughout the year. Standard time is therefore called winter time accordingly in some countries.

In countries where daylight saving time is implemented, there are only 23 hours a day in a year (the day when the daylight saving time begins), 25 hours a day (the day when the daylight saving time ends), and other times are 24 hours a day.

The green part is the countries and regions that are implemented globally in winter and summer time in 2019.

History of daylight saving time

In 1784, Benjamin Franklin, the US 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, the German government, during World War I, ordered the clock to be pushed to an hour later, and became the first country to implement daylight savings by obtaining an additional hour of daylight. Subsequently, the four countries participating in the First World War, Britain, France, Russia and the United States, followed suit.

After the end of World War I, the United States abolished the daylight saving time system in 1919, but in 1942, the United States restarted the daylight saving time system, and formal legislation in 1966 determined permanent use. During the outbreak of the oil crisis from 1973 to 1975, the United States extended the daylight saving time system for two consecutive years to save oil.

Most European countries only implemented the daylight saving time system 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 Implementing the Daylight Time System Nationwide", requiring the whole people to go to bed early and get up early to save energy: at 2:00 on the first Sunday in mid-April every year, the clock will be quickly accelerated by 2:00 on the first Sunday in mid-October, and at 2:00 on the first Sunday in mid-October, the clock will be slowed by 1 hour. However, this daylight saving time was only implemented for 6 years and was suspended in 1992. The main reason was that China's eastern and western regions were vast but only one Beijing time was pursued. The real-time daylight saving time system brought many unrealistic counter-effects.

Controversy over daylight saving time

Over the past 100 years, daylight saving time has often been favored only in the event of serious crises in the country (such as wars and energy shortages). And in the past decade of relatively peaceful times, this time system has become increasingly unpopular.

It will cause people's biological clocks to be disturbed and often fall into a lack of sleep. It will not only be harmful to human health and lead to car accidents, but also cause great chaos in the tourism and aviation fields.

In addition, whether winter and summer time can play an energy-saving role remains to be discussed. A U.S. study as of March 2014 showed that this time-shifting system can help the U.S. reduce electricity consumption by 1% by up to March and April, while the U.S. National Standards Agency believes that daylight saving time has no effect on electricity consumption.

In Russia, a previous report also showed that the electricity generated by daylight savings helps Russia save every year is only equivalent to the power generation of two or three thermal power plants, which is very "unspark".

On March 26 last year (2019), Germany, as the first country in the world to propose and implement summer time, passed the proposal to cancel the winter and summer time conversion system with a vote of 410 to 192 in the European Parliament. It is planned that from April 2021, all EU countries will no longer implement winter and summer time conversion. After the final bill is formed by each member state, it will choose to permanently use the Summer Time or Winter Time.

6. Local time

The time used in daily life we ​​usually call it local time. This time is equal to the local time in the time zone we are in (or used) and is defined by the offset from Universal Standard Time (UTC). This offset can be expressed as UTC- or UTC+, followed by the offset hours and minutes.

7. Date in JavaScript

Get the local time and print new Date() in different time zones, and the output results will be different:

new Date();

Get the number of milliseconds between the local time distance midnight (GMT time) on January 1, 1970:

new Date().getTime();

Returns the time difference between local time and GMT time in minutes:

new Date().getTimezoneOffset();

How to correctly display the local time anywhere (just know the timezone in the place):

//Target table time, East Eighth Districtlet timezone = 8;
//Get the time difference between local time and Greenwich time (note that it is minutes, remember to convert)const diff = new Date().getTimezoneOffset();
//Get Greenwich time based on local time and time differenceconst absTime = new Date().getTime() + diff * 60 * 1000;
//Get the time of each local time zone according to Greenwich time and local time zones, get the time of each local time zone according to Greenwich time and local time zone.let localTime = new Date(absTime + timeZone * 60 * 60 * 1000);
//Training daylight saving time (isDST encapsulates it for itself)if(isDST(localTime, country)) {
  localTime = new Date(absTime + (timeZone + 1) * 60 * 60 * 1000);
}
return localTime;

The above is the detailed content of JS's thorough understanding of GMT and UTC time zones. For more information about JS, please pay attention to my other related articles!