• 环境基于Centos7.6

1.作用

time_zone:该表提供查询时区ID和跳秒之间的映射关系数据。

time_zone_leap_second:该表提供查询跳秒机器修正值信息,与time_zone_transition表中信息类似,但后者还记录了时区ID等信息。

time_zone_name:该表提供查询时区的名称列表和时区ID的映射关系。

time_zone_transition:该表提供查询时区的跳秒数据。

time_zone_transition_type:该表提供查询具体的跳秒信息以及与时区的对应数据。

2.详解

1> time_zone

  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--下面是该表中存储的信息内容(需要手工导入时区数据信息到数据库才有数据)。

elect * from time_zone limit 1186,2;
+--------------+------------------+
| Time_zone_id | Use_leap_seconds |
+--------------+------------------+
| 2373 | N |
| 2375 | Y |
+--------------+------------------+
2 rows in set (0.01 sec)

--表字段含义:

Time_zone_id: 时区ID。

Use_leap_seconds: 表示该时区是否使用了跳秒(GPS原子钟时间和UTC时间之差,因为两个时间系统的秒长不一样,也就是我们所说的时间尺度不一样,最终随着时间的累积,两者之间就会差。而世界协调时为了协调人们生活中的时间,就采用了跳秒的办法来处理这种差异。目前两者之差为15秒)。

2> time_zone_leap_second

  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--下面是该表中存储的信息内容

select * from time_zone_leap_second;
+-----------------+------------+
| Transition_time | Correction |
+-----------------+------------+
| 78796800 | 1 |
| 94694401 | 2 |
......

--表字段含义。

Transition_time: 跳秒的瞬变时间(表示UTC和GPS时间的差异 ?

Correction: 跳秒的修正值。

3> time_zone_name

  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--下面是该表中存储的信息内容

select * from time_zone_name limit 2;
+----------------+--------------+
| Name | Time_zone_id |
+----------------+--------------+
| Africa/Abidjan | 1 |
| Africa/Accra | 3 |
+----------------+--------------+
2 rows in set (0.00 sec)

--表字段含义。

Name: 时区名称,该值为time_zone系统变量的有效值之一。

Time_zone_id: 时区ID,该ID和表time_zone中的ID相对应。

4> time_zone_transition

  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--下面是该表中存储的信息内容

select * from time_zone_transition limit 2;
+--------------+-----------------+--------------------+
| Time_zone_id | Transition_time | Transition_type_id |
+--------------+-----------------+--------------------+
| 1 | -1830383032 | 1 |
| 3 | -1640995148 | 2 |
+--------------+-----------------+--------------------+
2 rows in set (0.00 sec)

--表字段含义。

Time_zone_id: 时区ID。

Transition_time: 与time_zone_leap_second表中的Transition_time字段含义相同。

Transition_type_id: 与time_zone_transition_type表中的Transition_type_id相对应。

5> time_zone_transition_type

  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--下面是该表中存储的信息内容

select * from time_zone_transition_type limit 2;
+--------------+--------------------+--------+--------+--------------+
| Time_zone_id | Transition_type_id | Offset | Is_DST | Abbreviation |
+--------------+--------------------+--------+--------+--------------+
| 1 | 0 | -968 | 0 | LMT |
| 1 | 1 | 0 | 0 | GMT |
+--------------+--------------------+--------+--------+--------------+
2 rows in set (0.00 sec)

--表字段含义。

Time_zone_id: 时区ID。

Transition_type_id: 与time_zone_transition表中的Transition_type_id值对应。

Offset: 与UTC时间之间的偏移量。

Is_DST: ?

Abbreviation: 某某标准时间的缩写,例如:GMT,该值为time_zone系统变量的有效值之一。