Do you know so many mysteries about database time zone?

Time:2021-9-19

Summary:Introduction to time zone related knowledge and use in gaussdb (DWS).

This article is shared from Huawei cloud community《Everyone knows that there are so many mysteries behind the time zone》, original author: leapdb.

Background introduction

Like other industrial standards, the standardization process of time zone is also a complex and long process.Gaussdb (DWS), as a high-performance analytical database product for global users, supports time zones in line with industrial standards。 The following introduces gaussdb (DWS) from the concept of time zone, the use and principle of gaussdb (DWS) time zone, and some common problems.

I hope it will be helpful for you to understand the concepts of gaussdb (DWS) and time zone.

Concept article

In the past, when countries all over the world were in an agricultural society, people determined the time by observing the position of the sun every day, which made places with different longitudes have different times. At that time, people mainly traveled by walking and horses, and the problem of inconsistent time in different places was not so prominent. But in the 19th century, with the invention of the train, people’s travel distance in a day suddenly increased a lot, and they went to different places. Therefore, there is an urgent need for a general method to unify the time of each place. On August 12, 1853, two trains collided head-on in Rhode Island, the eastern United States, killing 14 people. The cause of the accident seems incredible today – the two car engineers’ watches are two minutes short.

  • In 1863, the concept of time zone was first used. The time zone partially solves this problem by setting the standard time of a region.
  • In the 1870s, Fleming, a Canadian railway engineer, first proposed that the world divide time zones according to unified standards.
  • On November 18, 1883, the U.S. Railway Department officially implemented five time zones.
  • In 1884, the Washington Meridian International Conference officially adopted this time zone division, which is called the world standard time system. Therefore, the birth of the world standard time zone, like other global standards, also has a slow development process.

1 explanation of terms

Time zone time zone is defined by the same time as the area on the earth. In the past, people determined time by observing the position (time angle) of the sun, which made the time different in places with different longitudes (local time). In 1863, the concept of time zone was first used. The time zone partially solves this problem by setting the standard time of a region. Countries all over the world are located in different positions on the earth, so the sunrise and sunset time of different countries, especially those with a large East-West span, must be different. These deviations are called jet lag.

Greenwich mean timeGMT (Greenwich mean time) refers to the standard time of the Royal Greenwich Observatory in the suburbs of London, England, because the primary meridian is defined as the longitude passing there. Due to the uneven speed of the earth in its elliptical orbit, the earth’s daily rotation is somewhat irregular and is slowing down slowly. Therefore, Greenwich mean time is no longer used as standard time.

World coordinated timeUTC (coordinated universal time) is a comprehensive actuarial time derived from the average solar time (GMT), the new time scale corrected by the earth’s axis motion and the international atomic time in seconds. UTC is more accurate than GMT. For the current table, there is no difference in function and accuracy between GMT and UTC.

Save time in summerDST (daylight saving time), also known as daylight saving time, is called summer time in Britain. It is a system of artificially setting local time to save energy. The unified time adopted during the implementation of this system is called “summer time”. Generally, in the summer when the dawn is early, artificially adjust the time by one hour, which can make people get up early and go to bed early, reduce the amount of lighting, so as to make full use of lighting resources and save lighting power. Each country adopting daylight saving time has different regulations.

Time zone representationIf the time is expressed in coordinated universal time (UTC), add a “Z” (without spaces) directly after the time. “Z” is the flag of time zone 0 in coordinated universal time. Therefore, “09:30 UTC” is written as “09:30z” or “0930z”. “14:45:15 UTC” is “14:45:15z” or “144515z”. UTC time is also called Zulu time because “Zulu” stands for “Z” in the NATO phonetic alphabet.

UTC offsetUTC offset is the date and time difference between coordinated universal time (UTC) and a specific location, in hours and minutes. It is usually displayed in the format of ± [HH]: [mm], ± HH, or ± [HH]. Therefore, if the time described is one hour earlier than UTC (such as winter time in Berlin), the offset of UTC will be “+ 01:00”, “0100”, or simply “+ 01”.

National time adjustment

  1. Morocco began to adjust the start time of daylight saving time from June 1 to May 2 and the end time from August 21 to August 8 in 2010
  2. Tunisia has abandoned daylight saving time since 2010
  3. Macquarie Island is located between Australia and Antarctica. It has decided not to follow other parts of Australia to adopt daylight saving time from April 4, 2010, resulting in a new time zone Antarctica / Macquarie, referred to as mist
  4. North Korea – the time zone has been adjusted since May 5, 2018. The time zone has been changed from GMT + 8:30 to GMT + 9:00. Therefore, the standard time of Pyongyang has been changed from 00:00:00 on Saturday, May 5, 2018 to 00:30:00, 30 minutes faster. When Greenwich GMT standard time is 0:00 a.m., Pyongyang time is 9:00 a.m., the same time zone as South Korea and Japan.
  5. North Korea – since August 15, 2015, GMT + 9 has been abandoned to “restore” the GMT + 8:30 standard time in the era of the Korean empire. The newly opened time is 30 minutes slower than the original time. It is the only country in the world that is using this time zone. When Greenwich GMT is 0:00 a.m., Pyongyang time is 8:30 a.m.
  6. Chile – on January 28, 2015, Chile adopted a new official standard time. They merged the original standard time and daylight saving time into one and permanently adopted daylight saving time. The new official time is changed to gmt-3 in mainland Chile and gmt-5 in Easter Island.
  7. Russia – from the early morning of the last Sunday in October 2014 (October 26, 2014), the winter time system will be permanently adopted, and the whole country will be set back by one hour. Therefore, Moscow time will be changed from GMT + 4 to GMT + 3.

It can be seen that both time zone and daylight saving time will often change.

2 general time format

Mainly refer to position 1003.1 section 8.3. The TZ environment variable in the operating system represents the time zone information, which is mainly used for CTime, Localtime, mktime, etc. TZ time zone name has two forms: time zone name format and POSIX time zone format.

2.1 time zone name format

: characters this form starts with a colon, and the subsequent character processing is related to the implementation. On Linux, it means to read the time zone information from a file, such as TZ = “: Pacific / AUCKLAND”.

2.2 POSIX time zone format

Any format that does not start with a colon is considered as this format. The extension is as follows. The field representation in [] is optional: STD offsetdst [offset, enddate [/ time]]]

Format:std offset[dst[offset][,startdate[/time], enddate[/time]]]

The meaning of each field is as follows:

  1. STD & & DST represents the standard time zone and daylight saving time zone. STD is required and DST is optional (if there is a DST field, it means that daylight saving time is supported). These two fields have two formats:
  • a. A string with reference symbol < >. The string in the reference symbol can be letters, numbers, +, -. The reference symbol < > is not included in parsing;
  • b. The other is without the reference symbol < >, and the string can only be letters.

The field length is greater than or equal to 3 and less than or equal to tzname_ Max (6 for Linux). If the string length does not meet the requirements, the parsing rules are not defined (not recognized by Linux).

  1. Offset represents local time plus how much UTC time can be obtained.

The format is HH [: mm [: SS]], 0 < = HH < = 24, 0 < = mm & & SS < = 59. HH is required and can be 1 bit, and mm and SS are optional.

  • If it is preceded by a plus sign +, it means west of the prime meridian. Indicates how much time is added to this time to get UTC time. Plus sign + can also be omitted.
  • If you take a minus sign in front of it — it means east of the prime meridian. Indicates how much time is subtracted from this time to get UTC time.

The offset after STD is required and the offset after DST is optional. If not, it is one hour earlier than the standard time by default.

  1. Rule indicates when to start and end daylight saving time. The agreement does not mention how to deal with the situation without rule. From the perspective of Linux system, m3.2.0/02:00:00 and m11.1.0/02:00:00 are handled by default.

The format is date [/ time], date [/ time]. Date has three forms:

a. Jn, 1 < = n < = 365, excluding February 29 of leap year;
b. N, 0 < = n < = 365, including February 29 of leap year;
c. Mm. N.D, M represents which month (1 < = m < = 12), n represents the week of the month (1 < = n < = 5), 5 represents the last, and D represents the day of the week (0 < = d < = 6, starting from Sunday).

  1. The time format is the same as offset, except that there is no + and -, if there is no time field, it defaults to 02:00:00.

For example: “utc-8:00:00dst-09:00:00, m3.2.0/02:00:00, m11.1.0/02:00:00”
It means that the local time is 8 hours east of UTC and supports daylight saving time. Daylight saving time is 9 hours (and one hour in advance). Daylight saving time starts at 2 a.m. on day 0 of week 2 in March and ends at 2 a.m. on day 0 of week 1 in November.
CST6CDT,M3.2.0/2:00:00,M11.1.0/2:00:00

The POSIX time zone format is not widely used because it cannot represent times that do not use the Gregorian calendar (such as Greece).

3 universal time zone database

Local time zone and daylight saving time rules are independently managed by their respective governments, who often change them with limited notice. And their historical data and future plans are only recorded intermittently. The universal time zone database attempts to organize and organize data related to this field.

Time zone database, commonly known as TZ, tzdata or zoninfo, is a group of historical information containing a large number of codes and data to represent the local time of many representative places in the world. It will be updated from time to time according to the changes of time zone boundaries and daylight saving time rules by various regimes. Each entry in the database represents the time zone information of the civil clock widely recognized since 1970. The database is referenced by many projects, such as the GNU C library (used in GNU / Linux), Android, FreeBSD, NetBSD, OpenBSD, chromium OS, cygwin, MariaDB, MINIX, mysql, WebOS, AIX, blackberry 10, IOS, MacOS, Microsoft Windows, OpenVMS, Oracle database, and Oracle Solaris. Like other widely used software products, gaussdb also adopts the general time zone data maintained by IANA.

The database was created by David Olson and edited and maintained by Paul Eggert. Therefore, it is also called Olson database in some places. Its remarkable feature is a set of general time zone naming rules designed by Paul Eggert. Each time zone gets a unique name according to the “region / location” format, such as “America / new_york”. The space in the English place name is replaced by the underscore “”, and the conjunction “-” is only used when the English place name itself is included. At present, there are generally two time zone databases called Olson time zone database or IANA time zone database.

Olson’s data has changed, partly because ad Olson is about to retire and partly because a lawsuit has been filed against defenders for copyright infringement (now revoked). On October 14, 2011, the internet name and name assignment Agency (IANA) took over the maintenance of the time zone database. It is regularly updated to reflect changes to time zone boundaries, UTC differences and daylight saving time rules by political entities. Updates to TZ are managed following the BCP 175 process. Some countries often change time zone rules. IANA releases the latest time zone data and parsing source code library every year.

In fact, how to define and manage time zones is controversial. There is no absolute authoritative time zone database. The universal time zone database maintained by IANA is widely used by GNU C library and BSD because each record identifies a clear information source and can predict the future time with historical information. In fact, there are other time zone databases, such as Microsoft time zone database, HP-UX time zone database and world time server(https://www.worldtimeserver.com/)And the standard timetable information manual of the International Air Transport Association.

Actual combat chapter

1 use of gaussdb (DWS) time zone

System table PG_ timezone_ Names records the time zone name.

testdb=# select * from pg_timezone_names where utc_offset='08:00:00';
        name        | abbrev | utc_offset | is_dst
--------------------+--------+------------+--------
 Asia/Kuala_Lumpur  | +08    | 08:00:00   | f
 Asia/Brunei        | +08    | 08:00:00   | f
 Asia/Makassar      | WITA   | 08:00:00   | f
 Asia/Harbin        | CST    | 08:00:00   | f
 Asia/Ujung_Pandang | WITA   | 08:00:00   | f
 Asia/Chungking     | CST    | 08:00:00   | f
 Asia/Kuching       | +08    | 08:00:00   | f
 Asia/Taipei        | CST    | 08:00:00   | f
 Asia/Macau         | CST    | 08:00:00   | f
 Asia/Macao         | CST    | 08:00:00   | f
 Asia/Manila        | PST    | 08:00:00   | f
 Asia/Chongqing     | CST    | 08:00:00   | f
 Asia/Shanghai      | CST    | 08:00:00   | f
 Asia/Choibalsan    | +08    | 08:00:00   | f
 Asia/Ulaanbaatar   | +08    | 08:00:00   | f
 Asia/Irkutsk       | +08    | 08:00:00   | f
 Asia/Ulan_Bator    | +08    | 08:00:00   | f
 Asia/Hong_Kong     | HKT    | 08:00:00   | f
 Asia/Singapore     | +08    | 08:00:00   | f
 Australia/West     | AWST   | 08:00:00   | f
 Australia/Perth    | AWST   | 08:00:00   | f
 ROC                | CST    | 08:00:00   | f
 Etc/GMT-8          | +08    | 08:00:00   | f
 PRC                | CST    | 08:00:00   | f
 Singapore          | +08    | 08:00:00   | f
 Antarctica/Casey   | +08    | 08:00:00   | f
 Hongkong           | HKT    | 08:00:00   | f
(27 rows)

System table PG_ timezone_ Abrevs records the abbreviation of the time zone

testdb=# select * from pg_timezone_abbrevs where utc_offset='08:00:00';
 abbrev | utc_offset | is_dst
--------+------------+--------
 AWST   | 08:00:00   | f
 BNT    | 08:00:00   | f
 BORT   | 08:00:00   | f
 CCT    | 08:00:00   | f
 HKT    | 08:00:00   | f
 IRKST  | 08:00:00   | f
 IRKT   | 08:00:00   | f
 MYT    | 08:00:00   | f
 PHT    | 08:00:00   | f
 SGT    | 08:00:00   | f
 ULAT   | 08:00:00   | f
 WADT   | 08:00:00   | t
(12 rows)

By setting the session environment variable timezone, you can set the time zone for database data warehousing and query. Why session level? What if the user does not set a different time zone, or the user forgets the previously set time zone?

A: after the time data is stored in the database, the background of the database management software will convert the time into UTC time zone 0. When querying, the user will convert it into the corresponding time according to the time zone set by the user. Therefore, the time zone set by the user does not affect the data storage, and there is no need to care about the time zone during data migration.

2 how to set the default time zone during gaussdb (DWS) initialization

If the time zone is not specified in the configuration file, the current operating system time zone is obtained from the current operating system environment variable TZ, and the time zone is the time zone supported in the database, the operating system time zone is used directly. Otherwise, some dates are constructed according to the current time of the operating system to judge which time zone matches the operating system better.

Evaluation method:

1) Collect some timestamps 100 years from now

First, detect January and July of the current year, which can quickly eliminate a large number of time zone inconsistencies.
Secondly, the detection of the week in the 100 years from July of the current year can effectively eliminate the time zone inconsistent with daylight saving time.

tnow = time(NULL); // Get the number of seconds elapsed since 1970-01-01 00:00:00 UTC
tm_ val = localtime(&tnow); // Convert the timestamp obtained from time () to the TM structure format of local time
thisyear = tm_ val->tm_ year + 1900; // tm_ Year is the number of years since 1900, so 1900 should be added
time_needto_test = 0;

//First construct a January 15 of the current year, and then adjust it to 00:00:00 on the first day of the current week
t = MakeTime(thisyear, 1, 15);
t -= (t % T_WEEK);
test_times[time_needto_test++] = t;

//Construct a July 15 of the current year, and then adjust it to 00:00:00 on the first day of the current week
t = MakeTime(thisyear, 7, 15);
t -= (t % T_WEEK);
test_times[time_needto_test++] = t;

//Time per week for 100 years after construction
while (tt.n_test_times < 52 * 100) {
    t -= T_WEEK;
    test_times[time_needto_test++] = t;
}

//A total of 5202 detection times were constructed

2) Judge the matching degree between the internal time zone of each database and the time zone of the operating system

If the time stamp converted to the operating system time zone is consistent with the time after it is converted to the internal time zone of the database to be tested, one point will be added. If a mismatch is encountered, the current time zone matching ends.

First, judge the matching degree between the time zone in “/ etc / Localtime” and the previous test time. If it matches completely, it returns success.

Otherwise, judge the matching degree of each time zone file under the database installation directory timezone with the previous test time, and obtain the time zone with the highest matching degree.

bestscore = 0;  
For (get each time zone file){

    Judge the matching degree between the current time zone file and the detection time
    score = score_timezone(tzdirsub, tt);

    If (score > bestscore) {// current time zone file matching > current maximum matching
        bestscore = score;
        bestzonename = tzdirsub;
    }Else if (score = = bestscore) {// if the matching degree of the current time zone file is equal to the current maximum matching degree, select the time zone with shorter length and higher alphabetical order
      if ((strlen(tzdirsub) < strlen(bestzonename) ||
          (strlen(tzdirsub) == strlen(bestzonename) && strcmp(tzdirsub, bestzonename) < 0))
          strlcpy(bestzonename, tzdirsub, TZ_STRLEN_MAX + 1);
    }
}

3) If the internal time zones of all databases match and the best score is still 0, you need to construct a POSIX style time zone consistent with the operating system time zone, for example: “psd8pdt”

Cold knowledge

What time zones are set in China?

Before 1912, there was no unified standard time in all parts of China. In the feudal era, the national standard calendar was promulgated by the imperial court, while the Chinese traditional calendar depended on the movement of the sun and moon at the same time and was subject to the actual astronomical observation. Therefore, the diachronic standard was subject to the longitude and latitude of the seat of the imperial court (to be exact, the observation point of the Imperial Academy).

In 1912, the Republic of China was established, and the time zone division was established and officially promulgated for the first time. China was divided into five time zones, which was officially promulgated in 1939.

1: Kunlun time zone (GMT + 5:30)
2: Xinzang time zone (GMT + 6)
3: Longshu time zone (GMT + 7)
4: Zhongyuan standard time zone (GMT + 8)
5: Changbai time zone (GMT + 8:30)
Do you know so many mysteries about database time zone?

Details are as follows:

Asia / Harbin, also known as the Changbai time zone, mainly represents the time in Heilongjiang (excluding Mohe) and Jilin

# Zone  NAME            GMTOFF  RULES   FORMAT  [UNTIL]
# Changbai Time ("Long-white Time", Long-white = Heilongjiang area)
# Heilongjiang (except Mohe county), Jilin
Zone    Asia/Harbin     8:26:44 -       LMT     1928 # or Haerbin
                        8:30    -       CHAT    1932 Mar # Changbai Time
                        8:00    -       CST     1940
                        9:00    -       CHAT    1966 May
                        8:30    -       CHAT    1980 May
                        8:00    PRC     C%sT

Asia / Shanghai is also called Zhongyuan standard time zone

# Zhongyuan Time ("Central plain Time")
# most of China
# Milne gives 8:05:56.7; round to nearest.
Zone    Asia/Shanghai   8:05:57 -       LMT     1928
                        8:00    Shang   C%sT    1949
                        8:00    PRC     C%sT

Asia / Chongqing, also known as the hazy Shu time zone, mainly represents the main parts of Guangxi, Guizhou, Hainan, Ningxia, Sichuan, Shaanxi, Yunnan and Gansu, the west of Inner Mongolia, the west of Qinghai, Deqing, Enping, Kaiping, Luoding, Taishan, Xinxing, Yangchun, Yangjiang, Yunan and Yunfu in Guangdong. It is the East seven districts.

# Long-shu Time (probably due to Long and Shu being two names of that area)
# Guangxi, Guizhou, Hainan, Ningxia, Sichuan, Shaanxi, and Yunnan;
# most of Gansu; west Inner Mongolia; west Qinghai; and the Guangdong
# counties Deqing, Enping, Kaiping, Luoding, Taishan, Xinxing,
# Yangchun, Yangjiang, Yu'nan, and Yunfu.
Zone    Asia/Chongqing  7:06:20 -       LMT     1928 # or Chungking
                        7:00    -       LONT    1980 May # Long-shu Time
                        8:00    PRC     C%sT

Asia / Urumqi, also known as the new Tibet time zone, mainly represents Aksai Kazakh Autonomous County, Anxi County, Dunhuang, Subei County, Lianjiang county, Zhanjiang City, etc. in Gansu Province.

# Xin-zang Time ("Xinjiang-Tibet Time")
# The Gansu counties Aksay, Anxi, Dunhuang, Subei; west Qinghai;
# the Guangdong counties  Xuwen, Haikang, Suixi, Lianjiang,
# Zhanjiang, Wuchuan, Huazhou, Gaozhou, Maoming, Dianbai, and Xinyi;
# east Tibet, including Lhasa, Chamdo, Shigaise, Jimsar, Shawan and Hutubi;
# east Xinjiang, including Urumqi, Turpan, Karamay, Korla, Minfeng, Jinghe,
# Wusu, Qiemo, Xinyan, Wulanwusu, Jinghe, Yumin, Tacheng, Tuoli, Emin,
# Shihezi, Changji, Yanqi, Heshuo, Tuokexun, Tulufan, Shanshan, Hami,
# Fukang, Kuitun, Kumukuli, Miquan, Qitai, and Turfan.
Zone    Asia/Urumqi     5:50:20 -       LMT     1928 # or Urumchi
                        6:00    -       URUT    1980 May # Urumqi Time
                        8:00    PRC     C%sT

Asia / Kashgar, also known as Kunlun time zone, mainly represents Western Tibet (Pulan County, Aheqi County, Shufu County, Shule county), western Xinjiang (Aksu, Atush, Yining, Hotan, Cele, lop, nilek, Zhaosu, Tex, Gongliu, Chabuchar, Huocheng, bole, Pishan, etc.)

Zone    Asia/Kashgar    5:03:56 -       LMT     1928 # or Kashi or Kaxgar
                        5:30    -       KAST    1940     # Kashgar Time
                        5:00    -       KAST    1980 May
                        8:00    PRC     C%sT

PRC points to the Central Plains standard time zone

Link Asia/Shanghai PRC
When the people’s Republic of China was founded in 1949, China abolished the Central Plains Standard Time Zone, Kunlun time zone, Changbai time zone, Longshu time zone and Xinzang time zone established by the former national government in 1939, which were uniformly used throughout the country (UTC + 8) and named Beijing time.
After 1950, Beijing time was uniformly used throughout the country except Tibet and Xinjiang. At that time, the local people’s Congress of Xinjiang set Urumqi time: (UTC + 6) for the convenience of the masses. For example, it was 8:00 Beijing time and 6:00 Urumqi time. The new time zone adjustment is as follows:

1) The time zone names of Asia / Harbin, Asia / Chongqing and Asia / Shanghai are reserved, and the definitions point to the newly defined Asia / Shanghai. It is used uniformly throughout the country.

The Central Plains standard time zone is renamed Beijing time zone, and the offset is adjusted

# Zone  NAME            STDOFF  RULES   FORMAT  [UNTIL]
# Beijing time, used throughout China; represented by Shanghai.
Zone    Asia/Shanghai   8:05:43 -       LMT     1901
                        8:00    Shang   C%sT    1949 May 28
                        8:00    PRC     C%sT

2) The time zone names of Asia / Kashgar (Kunlun time zone) and Asia / Urumqi (New Tibet time zone) are reserved, and the definitions all point to the newly defined Asia / Urumqi (Urumqi time zone). The local uses two time zone definitions at the same time.

The new Tibetan time zone was renamed Xinjiang time zone, and the offset was adjusted

# Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi
# / Wulumuqi.  (Please use Asia/Shanghai if you prefer Beijing time.)
Zone    Asia/Urumqi     5:50:20 -       LMT     1928
                        6:00    -       +06

Merged time zone

L Asia / Urumqi Asia / Kashgar Kunlun time zone combined with Xinzang time zone
L Asia / Shanghai Asia / Harbin Changbai time zone is integrated into the Central Plains standard time zone
The L Asia / Shanghai Asia / Chongqing time zone is integrated into the Central Plains standard time zone
L Asia / Shanghai Asia / Chungking is a new alias of Chungking, which is also incorporated into the Central Plains standard time zone
L Asia/Shanghai PRC

Why is there no Beijing time zone, only Beijing time?

Due to various political reasons, the country, region, country name and country of the region will often change, which brings a lot of trouble to the time zone management. For example, the landlocked country “Kingdom of Swaziland”, located in southeast Africa, announced in April 2018 that the country name would be changed to “eswatini”; On July 1, 1997, which we are absolutely familiar with, Hong Kong returned from the British colony to the embrace of our great motherland, and its country changed. Therefore, IANA’s strategy is to remain neutral to political changes. Time zones are usually not bound to countries, and each country or national capital is not required to have a time zone name.

For the convenience of domestic users, gaussdb (DWS) internally helps users define the Asia / Beijing time zone according to the syntax rules defined by IANA, which is consistent with the PRC time zone definition.

3 is the definition of time zone invariable?

How to define and manage time zones is controversial. There is no absolute authoritative time zone database. The change of time zone information of a country or region is an independent matter and has no obligation to notify IANA. The authority of IANA time zone database mainly depends on the time zone database maintainer’s understanding of relevant countries or regions.

Therefore, the time zone definition of IANA records the source of time zone information collected by the time zone database maintainer, which is sometimes not very objective. The following is the reference basis for China’s time zone information in IANA.

From Guy Harris:
From Bob Devine (1988-01-28): See TIME mag, 1986-02-17 p.52.
From U. S. Naval Observatory (1989-01-19): 
From Anthony Fok (2001-12-20): from some Taiwan websites
From Paul Eggert (2006-03-22): Devine's note about Time magazine
From Jesper Norgaard Welen (2006-07-14): http://www.astro.com/atlas
From Paul Eggert (2008-02-11): I just now checked Google News for western news sources

From David Cochrane (2014-03-26): https://content.time.com/time/magazine/article/0,9171,960684,00.html
From Luther Ma (2014-04-22): Guo's report regarding Xinjiang
From Paul Eggert (2014-06-30): http://www.sinkiang.gov.cn/service/ourworking (2014-04-22).
From Paul Eggert (2017-01-05):
  Guo Qing-sheng (National Time-Service Center, CAS, Xi'an 710600, China)
  (Zhongguo Ke Ji Shi Liao, historical materials of Chinese science and Technology). 2003; 24(1):5-9.
  http://oversea.cnki.net/kcms/detail/detail.aspx?filename=ZGKS200301000&dbname=CJFD2003
  Guo Qing-sheng (Shaanxi Astronomical Observatory, CAS, Xi'an 710600, China)
  An AP article "Shanghai Internat'l Area Little Changed"
From P Chan (2018-05-07):
  1986-04-12 http://www.zj.gov.cn/attach/zfgb/198608.pdf p.21-22
  1987-02-15 http://www.gov.cn/gongbao/shuju/1987/gwyb198703.pdf p.114
  1987-09-09 http://www.gov.cn/gongbao/shuju/1987/gwyb198721.pdf p.709
  1992-03-03 http://www.gov.cn/gongbao/shuju/1992/gwyb199205.pdf p.152
  http://data.people.com.cn/pic/101p/1988/04/1988041201.jpg

It can be seen that before 2014, IANA collected China’s time zone information mostly from western news, magazines, Taiwan websites and so on. The information collected after 2014 comes from China’s Xi’an time service center, national portal website, etc.

In addition, because the time zone information of many countries often changes, the time zone data in the IANA universal time zone database will be updated frequently. As a universal database product for the world, gaussdb (DWS) will also synchronize the latest time zone information from IANA every time a new version is published to ensure that users’ software products maintain the latest time zone information.

4 Why do we need to pay little attention to time zones?

Since the cancellation of daylight saving time in 1992, our time zone information has never changed, which has brought great convenience to our production and life. Domestic users no longer need to care about time zone related issues.

summary

In conclusion, as a high-performance analytical database product for global users, gaussdb (DWS) supports time zones in line with industrial standards and specifications. The use of time zone in gaussdb (DWS) is simple and convenient, and the selection of default time zone is also scientific and reasonable.

For more information on GuassDB (DWS), WeChat search is welcome to search WeChat DWS for WeChat official account and share with you the latest and most complete PB technology.

Click focus to learn about Huawei cloud’s new technologies for the first time~