基于PostgreSQL的时区问题解决

目录

 

●实际业务场景中遇到的问题

●时间戳(timestamp)定义

●PostgreSQL时间日期类型

●PostgreSQL时间戳使用的问题

●解决方案一:变更字段类型

●解决方案二:SQL层面

●解决方案三:Java层面

●附.Java timezone时区列表

●附.PostgreSQL时区列表


●实际业务场景中遇到的问题

最近在工作中遇到这么一个需求,用户要求存入的时间和取出的时间相同,业务场景是国际不同地区、夏令时、标准时等。注意:此处的相同指的是用户看到的时间要一样,即在有时区差异的A地存入“2018-12-01 12:12:12.123”,在B地也显示“2018-12-01 12:12:12.123”。这样做的业务场景是用户在B地取出数据库中的时间戳字段,想知道当时的A地时间,而不是B地时间,因此要保持显示为A地时间,方便沟通。

 

●时间戳(timestamp)定义

时间戳指的是从格林威治时间1970年01月01日00时00分00秒起至现在的总秒数。严格来说,不管你处在地球上的哪个地方,任意时间点的时间戳都是相同的。这点有利于线上和客户端分布式应用统一追踪时间信息。
 

●PostgreSQL时间日期类型

名称

描述

精度

数据库显示 示例

timestamp [ (p) ] [ without time zone ]

日期+时间,不带时区

毫秒

2018-02-01 10:33:20.125

timestamp [ (p) ] with time zone

日期+时间,带时区

毫秒

2018-02-01 10:33:20.125+08

date

日期

2018-02-01

time [ (p) ] [ without time zone ]

时间,不带时区

毫秒

10:33:20.125

time [ (p) ] with time zone

时间,带时区

毫秒

10:33:20.125+08

根据业务需求,我们存入的数据,例如记录创建时间是包括日期、时间、时区的ISO8601标准时间,因此,能够选择的时间日期类型是timestamp with time zone。

 

●PostgreSQL时间戳使用的问题

虽然时间戳实际上是一个数值,但PostgreSQL在设计的时候,就屏蔽了其底层的真实值,而是以标准ISO8601的规范展示给用户,并且默认是根据系统所在时区自动显示到当前的时区。当然,可以通过数据库的配置文件更改时区,以更换显示的值。但根据时间戳的定义,其真实的、底层的秒数数值是不变的。
可以做以下实验,插入+8时区的数据如下:

变换时区,查看timestamp_with_zone的值如下:

基于PostgreSQL的时区问题解决_第1张图片

可以发现,相同的时间戳,在不同的时区下对用户表现的形式也不一样。为了验证确实是同一个时间戳,我们继续查看其秒数:

基于PostgreSQL的时区问题解决_第2张图片

 

●解决方案一:变更字段类型

最简单方式,例如为了存入一个诸如“2018-02-01T10:33:20.125+08:00”的时间数据,直接将时间日期字段用varchar进行存储。这样,用户在A地存入什么,在B地、C地、……取出还是这个值,不可能变化(相同字符集编码的前提下)。但其排序性能没有timestamp好,因此,如果要对该字段加上索引并有先后次序的话,该解决方案并不适用。

 

●解决方案二:SQL层面

PostgreSQL提供时区的操作,我们可以通过设置本地时区(系统级或数据库级)来更换显示的时间日期,诸如“PostgreSQL时间戳使用的问题”中实验所示。还可以使用“at time zone”关键字在SQL查询语句中直接进行转化,如下所示:

--原时间(带时区)
SELECT timestamp_with_zone  FROM test WHERE id = 1;

--直接写时区偏移(基于格林威治时区,是反的,即提前-滞后+,例如正常东八区,需要写-8:00,因此建议直接用时区缩写)
SELECT timestamp_with_zone at time zone '-8:00' FROM test WHERE id = 1;

--中国沿海时间 +8:00
SELECT timestamp_with_zone at time zone 'CCT' FROM test WHERE id = 1;

--格林威治时间 +0:00
SELECT timestamp_with_zone at time zone 'GMT' FROM test WHERE id = 1;

--(美国)太平洋标准时间PDT -7:00
SELECT timestamp_with_zone at time zone 'PDT' FROM test WHERE id = 1;

--(美国)太平洋夏令时PST -8:00
SELECT timestamp_with_zone at time zone 'PST' FROM test WHERE id = 1;

查询结果如下:

基于PostgreSQL的时区问题解决_第3张图片

这种方案的优势在于时区转换在SQL层面完成,因为直接查和使用“at time zone”都是将时间戳秒数转化为用户友好型的ISO8601标准时间格式,几乎没有额外的资源消耗。劣势在于JAVA开发后端需要进行dao层重构,添加自定义的查询函数执行原生SQL。值得注意的是,我们可能会需要用额外的一个字段存储A地的时区,这样在B地查询的时候,才能从数据库知道A地时区,也才能拼接出如上的查询SQL。
“附.PostgreSQL支持时区”中提供了PostgreSQL中能使用的时区,当然,也可以直接通过加减数字的方式使用自定义的时区偏移。
 

●解决方案三:Java层面

利用Java提供的timezone,我们可以在后端进行时间的转化,定义如下的工具类:

public class DateTools {
  public static String timestampToStr(java.sql.Timestamp time, String strFormat) {
    DateFormat df = new SimpleDateFormat(strFormat);
    String str = df.format(time);
    return str;
  }

  public static java.util.Date timestampToDate(java.sql.Timestamp time) {
    return time;
  }

  public static String getZonedDateTime(Timestamp timestamp, String zone, String formatStr){
    TimeZone timeZone = TimeZone.getTimeZone(zone);
    Date date = timestampToDate(timestamp);
    DateFormat df = new SimpleDateFormat(formatStr);
    df.setTimeZone(timeZone);
    return df.format(date);
  }
}

进行测试,其中时区字符串见“附.Java timezone时区列表”:

public void fun1() {
    System.out.println("时间戳测试开始————————");

    Timestamp timestampWithZone = timeTestRepository.getTimestampWithZoneById(1L);
    String local = DateTools.timestampToStr(timestampWithZone, "yyyy-MM-dd HH:mm:ss +z");
    String pst = DateTools.getZonedDateTime(timestampWithZone,"PST","yyyy-MM-dd HH:mm:ss +z");
    String hst = DateTools.getZonedDateTime(timestampWithZone,"HST","yyyy-MM-dd HH:mm:ss +z");

    System.out.println("本地时区时间——");
    System.out.println(local);
    System.out.println("pst时区时间——");
    System.out.println(pst);
    System.out.println("hst时区时间——");
    System.out.println(hst);
  }

结果如下:

基于PostgreSQL的时区问题解决_第4张图片

其转化结果和方案二是一直的,都能实现用户在不同时区查看的时间是当地时间的业务需求。这种方案的优势在于不需要修改dao层代码,例如Spring Data JPA的Repository接口。劣势在于将计算资源移至了Java服务器后端,性能上不如直接SQL层面的高。同样地,我们也需要在数据库用一个字段保存用户存储的时区。

 

●附.Java timezone时区列表

Etc/GMT+12

Etc/GMT+11
MIT
Pacific/Apia
Pacific/Midway
Pacific/Niue
Pacific/Pago_Pago
Pacific/Samoa
US/Samoa
America/Adak
America/Atka

Etc/GMT+10
HST
Pacific/Fakaofo
Pacific/Honolulu
Pacific/Johnston
Pacific/Rarotonga
Pacific/Tahiti
SystemV/HST10
US/Aleutian
US/Hawaii
Pacific/Marquesas
AST
America/Anchorage
America/Juneau
America/Nome
America/Yakutat

Etc/GMT+9
Pacific/Gambier
SystemV/YST9
SystemV/YST9YDT
US/Alaska
America/Dawson
America/Ensenada
America/Los_Angeles
America/Tijuana
America/Vancouver
America/Whitehorse
Canada/Pacific
Canada/Yukon

Etc/GMT+8
Mexico/BajaNorte
PST
PST8PDT
Pacific/Pitcairn
SystemV/PST8
SystemV/PST8PDT
US/Pacific
US/Pacific-New
America/Boise
America/Cambridge_Bay
America/Chihuahua
America/Dawson_Creek
America/Denver
America/Edmonton
America/Hermosillo
America/Inuvik
America/Mazatlan
America/Phoenix
America/Shiprock
America/Yellowknife
Canada/Mountain

Etc/GMT+7
MST
MST7MDT
Mexico/BajaSur
Navajo
PNT
SystemV/MST7
SystemV/MST7MDT
US/Arizona
US/Mountain
America/Belize
America/Cancun
America/Chicago
America/Costa_Rica
America/El_Salvador
America/Guatemala
America/Indiana/Knox
America/Indiana/Tell_City
America/Knox_IN
America/Managua
America/Menominee
America/Merida
America/Mexico_City
America/Monterrey
America/North_Dakota/Center
America/North_Dakota/New_Salem
America/Rainy_River
America/Rankin_Inlet
America/Regina
America/Swift_Current
America/Tegucigalpa
America/Winnipeg
CST
CST6CDT
Canada/Central
Canada/East-Saskatchewan
Canada/Saskatchewan
Chile/EasterIsland

Etc/GMT+6
Mexico/General
Pacific/Easter
Pacific/Galapagos
SystemV/CST6
SystemV/CST6CDT
US/Central
US/Indiana-Starke
America/Atikokan
America/Bogota
America/Cayman
America/Coral_Harbour
America/Detroit
America/Eirunepe
America/Fort_Wayne
America/Grand_Turk
America/Guayaquil
America/Havana
America/Indiana/Indianapolis
America/Indiana/Marengo
America/Indiana/Petersburg
America/Indiana/Vevay
America/Indiana/Vincennes
America/Indiana/Winamac
America/Indianapolis
America/Iqaluit
America/Jamaica
America/Kentucky/Louisville
America/Kentucky/Monticello
America/Lima
America/Louisville
America/Montreal
America/Nassau
America/New_York
America/Nipigon
America/Panama
America/Pangnirtung
America/Port-au-Prince
America/Porto_Acre
America/Resolute
America/Rio_Branco
America/Thunder_Bay
America/Toronto
Brazil/Acre
Canada/Eastern
Cuba
EST
EST5EDT

Etc/GMT+5
IET
Jamaica
SystemV/EST5
SystemV/EST5EDT
US/East-Indiana
US/Eastern
US/Michigan
America/Caracas
America/Anguilla
America/Antigua
America/Aruba
America/Asuncion
America/Barbados
America/Blanc-Sablon
America/Boa_Vista
America/Campo_Grande
America/Cuiaba
America/Curacao
America/Dominica
America/Glace_Bay
America/Goose_Bay
America/Grenada
America/Guadeloupe
America/Guyana
America/Halifax
America/La_Paz
America/Manaus
America/Marigot
America/Martinique
America/Moncton
America/Montserrat
America/Port_of_Spain
America/Porto_Velho
America/Puerto_Rico
America/Santiago
America/Santo_Domingo
America/St_Barthelemy
America/St_Kitts
America/St_Lucia
America/St_Thomas
America/St_Vincent
America/Thule
America/Tortola
America/Virgin
Antarctica/Palmer
Atlantic/Bermuda
Atlantic/Stanley
Brazil/West
Canada/Atlantic
Chile/Continental

Etc/GMT+4
PRT
SystemV/AST4
SystemV/AST4ADT
America/St_Johns
CNT
Canada/Newfoundland
AGT
America/Araguaina
America/Argentina/Buenos_Aires
America/Argentina/Catamarca
America/Argentina/ComodRivadavia
America/Argentina/Cordoba
America/Argentina/Jujuy
America/Argentina/La_Rioja
America/Argentina/Mendoza
America/Argentina/Rio_Gallegos
America/Argentina/San_Juan
America/Argentina/San_Luis
America/Argentina/Tucuman
America/Argentina/Ushuaia
America/Bahia
America/Belem
America/Buenos_Aires
America/Catamarca
America/Cayenne
America/Cordoba
America/Fortaleza
America/Godthab
America/Jujuy
America/Maceio
America/Mendoza
America/Miquelon
America/Montevideo
America/Paramaribo
America/Recife
America/Rosario
America/Sao_Paulo
Antarctica/Rothera
BET
Brazil/East

Etc/GMT+3
America/Noronha
Atlantic/South_Georgia
Brazil/DeNoronha

Etc/GMT+2
America/Scoresbysund
Atlantic/Azores
Atlantic/Cape_Verde

Etc/GMT+1
Africa/Abidjan
Africa/Accra
Africa/Bamako
Africa/Banjul
Africa/Bissau
Africa/Casablanca
Africa/Conakry
Africa/Dakar
Africa/El_Aaiun
Africa/Freetown
Africa/Lome
Africa/Monrovia
Africa/Nouakchott
Africa/Ouagadougou
Africa/Sao_Tome
Africa/Timbuktu
America/Danmarkshavn
Atlantic/Canary
Atlantic/Faeroe
Atlantic/Faroe
Atlantic/Madeira
Atlantic/Reykjavik
Atlantic/St_Helena
Eire

Etc/GMT

Etc/GMT+0

Etc/GMT-0

Etc/GMT0
Etc/Greenwich
Etc/UCT
Etc/UTC
Etc/Universal
Etc/Zulu
Europe/Belfast
Europe/Dublin
Europe/Guernsey
Europe/Isle_of_Man
Europe/Jersey
Europe/Lisbon
Europe/London
GB
GB-Eire
GMT
GMT0
Greenwich
Iceland
Portugal
UCT
UTC
Universal
WET
Zulu
Africa/Algiers
Africa/Bangui
Africa/Brazzaville
Africa/Ceuta
Africa/Douala
Africa/Kinshasa
Africa/Lagos
Africa/Libreville
Africa/Luanda
Africa/Malabo
Africa/Ndjamena
Africa/Niamey
Africa/Porto-Novo
Africa/Tunis
Africa/Windhoek
Arctic/Longyearbyen
Atlantic/Jan_Mayen
CET
ECT

Etc/GMT-1
Europe/Amsterdam
Europe/Andorra
Europe/Belgrade
Europe/Berlin
Europe/Bratislava
Europe/Brussels
Europe/Budapest
Europe/Copenhagen
Europe/Gibraltar
Europe/Ljubljana
Europe/Luxembourg
Europe/Madrid
Europe/Malta
Europe/Monaco
Europe/Oslo
Europe/Paris
Europe/Podgorica
Europe/Prague
Europe/Rome
Europe/San_Marino
Europe/Sarajevo
Europe/Skopje
Europe/Stockholm
Europe/Tirane
Europe/Vaduz
Europe/Vatican
Europe/Vienna
Europe/Warsaw
Europe/Zagreb
Europe/Zurich
MET
Poland
ART
Africa/Blantyre
Africa/Bujumbura
Africa/Cairo
Africa/Gaborone
Africa/Harare
Africa/Johannesburg
Africa/Kigali
Africa/Lubumbashi
Africa/Lusaka
Africa/Maputo
Africa/Maseru
Africa/Mbabane
Africa/Tripoli
Asia/Amman
Asia/Beirut
Asia/Damascus
Asia/Gaza
Asia/Istanbul
Asia/Jerusalem
Asia/Nicosia
Asia/Tel_Aviv
CAT
EET
Egypt

Etc/GMT-2
Europe/Athens
Europe/Bucharest
Europe/Chisinau
Europe/Helsinki
Europe/Istanbul
Europe/Kaliningrad
Europe/Kiev
Europe/Mariehamn
Europe/Minsk
Europe/Nicosia
Europe/Riga
Europe/Simferopol
Europe/Sofia
Europe/Tallinn
Europe/Tiraspol
Europe/Uzhgorod
Europe/Vilnius
Europe/Zaporozhye
Israel
Libya
Turkey
Africa/Addis_Ababa
Africa/Asmara
Africa/Asmera
Africa/Dar_es_Salaam
Africa/Djibouti
Africa/Kampala
Africa/Khartoum
Africa/Mogadishu
Africa/Nairobi
Antarctica/Syowa
Asia/Aden
Asia/Baghdad
Asia/Bahrain
Asia/Kuwait
Asia/Qatar
Asia/Riyadh
EAT

Etc/GMT-3
Europe/Moscow
Europe/Volgograd
Indian/Antananarivo
Indian/Comoro
Indian/Mayotte
W-SU
Asia/Riyadh87
Asia/Riyadh88
Asia/Riyadh89
Mideast/Riyadh87
Mideast/Riyadh88
Mideast/Riyadh89
Asia/Tehran
Iran
Asia/Baku
Asia/Dubai
Asia/Muscat
Asia/Tbilisi
Asia/Yerevan

Etc/GMT-4
Europe/Samara
Indian/Mahe
Indian/Mauritius
Indian/Reunion
NET
Asia/Kabul
Asia/Aqtau
Asia/Aqtobe
Asia/Ashgabat
Asia/Ashkhabad
Asia/Dushanbe
Asia/Karachi
Asia/Oral
Asia/Samarkand
Asia/Tashkent
Asia/Yekaterinburg

Etc/GMT-5
Indian/Kerguelen
Indian/Maldives
PLT
Asia/Calcutta
Asia/Colombo
Asia/Kolkata
IST
Asia/Katmandu
Antarctica/Mawson
Antarctica/Vostok
Asia/Almaty
Asia/Bishkek
Asia/Dacca
Asia/Dhaka
Asia/Novosibirsk
Asia/Omsk
Asia/Qyzylorda
Asia/Thimbu
Asia/Thimphu
BST

Etc/GMT-6
Indian/Chagos
Asia/Rangoon
Indian/Cocos
Antarctica/Davis
Asia/Bangkok
Asia/Ho_Chi_Minh
Asia/Hovd
Asia/Jakarta
Asia/Krasnoyarsk
Asia/Phnom_Penh
Asia/Pontianak
Asia/Saigon
Asia/Vientiane

Etc/GMT-7
Indian/Christmas
VST
Antarctica/Casey
Asia/Brunei
Asia/Choibalsan
Asia/Chongqing
Asia/Chungking
Asia/Harbin
Asia/Hong_Kong
Asia/Irkutsk
Asia/Kashgar
Asia/Kuala_Lumpur
Asia/Kuching
Asia/Macao
Asia/Macau
Asia/Makassar
Asia/Manila
Asia/Shanghai
Asia/Singapore
Asia/Taipei
Asia/Ujung_Pandang
Asia/Ulaanbaatar
Asia/Ulan_Bator
Asia/Urumqi
Australia/Perth
Australia/West
CTT

Etc/GMT-8
Hongkong
PRC
Singapore
Australia/Eucla
Asia/Dili
Asia/Jayapura
Asia/Pyongyang
Asia/Seoul
Asia/Tokyo
Asia/Yakutsk

Etc/GMT-9
JST
Japan
Pacific/Palau
ROK
ACT
Australia/Adelaide
Australia/Broken_Hill
Australia/Darwin
Australia/North
Australia/South
Australia/Yancowinna
AET
Antarctica/DumontDUrville
Asia/Sakhalin
Asia/Vladivostok
Australia/ACT
Australia/Brisbane
Australia/Canberra
Australia/Currie
Australia/Hobart
Australia/Lindeman
Australia/Melbourne
Australia/NSW
Australia/Queensland
Australia/Sydney
Australia/Tasmania
Australia/Victoria

Etc/GMT-10
Pacific/Guam
Pacific/Port_Moresby
Pacific/Saipan
Pacific/Truk
Pacific/Yap
Australia/LHI
Australia/Lord_Howe
Asia/Magadan

Etc/GMT-11
Pacific/Efate
Pacific/Guadalcanal
Pacific/Kosrae
Pacific/Noumea
Pacific/Ponape
SST
Pacific/Norfolk
Antarctica/McMurdo
Antarctica/South_Pole
Asia/Anadyr
Asia/Kamchatka

Etc/GMT-12
Kwajalein
NST
NZ
Pacific/Auckland
Pacific/Fiji
Pacific/Funafuti
Pacific/Kwajalein
Pacific/Majuro
Pacific/Nauru
Pacific/Tarawa
Pacific/Wake
Pacific/Wallis
NZ-CHAT
Pacific/Chatham

Etc/GMT-13
Pacific/Enderbury
Pacific/Tongatapu

Etc/GMT-14
Pacific/Kiritimati
 

●附.PostgreSQL时区列表

Africa/Abidjan

GMT

0:00:00

Africa/Accra

GMT

0:00:00

Africa/Addis_Ababa

EAT

3:00:00

Africa/Algiers

CET

1:00:00

Africa/Asmara

EAT

3:00:00

Africa/Asmera

EAT

3:00:00

Africa/Bamako

GMT

0:00:00

Africa/Bangui

WAT

1:00:00

Africa/Banjul

GMT

0:00:00

Africa/Bissau

GMT

0:00:00

Africa/Blantyre

CAT

2:00:00

Africa/Brazzaville

WAT

1:00:00

Africa/Bujumbura

CAT

2:00:00

Africa/Cairo

EET

2:00:00

Africa/Casablanca

WET

0:00:00

Africa/Ceuta

CET

1:00:00

Africa/Conakry

GMT

0:00:00

Africa/Dakar

GMT

0:00:00

Africa/Dar_es_Salaam

EAT

3:00:00

Africa/Djibouti

EAT

3:00:00

Africa/Douala

WAT

1:00:00

Africa/El_Aaiun

WET

0:00:00

Africa/Freetown

GMT

0:00:00

Africa/Gaborone

CAT

2:00:00

Africa/Harare

CAT

2:00:00

Africa/Johannesburg

SAST

2:00:00

Africa/Juba

EAT

3:00:00

Africa/Kampala

EAT

3:00:00

Africa/Khartoum

EAT

3:00:00

Africa/Kigali

CAT

2:00:00

Africa/Kinshasa

WAT

1:00:00

Africa/Lagos

WAT

1:00:00

Africa/Libreville

WAT

1:00:00

Africa/Lome

GMT

0:00:00

Africa/Luanda

WAT

1:00:00

Africa/Lubumbashi

CAT

2:00:00

Africa/Lusaka

CAT

2:00:00

Africa/Malabo

WAT

1:00:00

Africa/Maputo

CAT

2:00:00

Africa/Maseru

SAST

2:00:00

Africa/Mbabane

SAST

2:00:00

Africa/Mogadishu

EAT

3:00:00

Africa/Monrovia

GMT

0:00:00

Africa/Nairobi

EAT

3:00:00

Africa/Ndjamena

WAT

1:00:00

Africa/Niamey

WAT

1:00:00

Africa/Nouakchott

GMT

0:00:00

Africa/Ouagadougou

GMT

0:00:00

Africa/Porto-Novo

WAT

1:00:00

Africa/Sao_Tome

GMT

0:00:00

Africa/Timbuktu

GMT

0:00:00

Africa/Tripoli

EET

2:00:00

Africa/Tunis

CET

1:00:00

Africa/Windhoek

WAST

2:00:00

America/Adak

HAST

-10:00:00

America/Anchorage

AKST

-09:00:00

America/Anguilla

AST

-04:00:00

America/Antigua

AST

-04:00:00

America/Araguaina

BRT

-03:00:00

America/Argentina/Buenos_Aires

ART

-03:00:00

America/Argentina/Catamarca

ART

-03:00:00

America/Argentina/ComodRivadavia

ART

-03:00:00

America/Argentina/Cordoba

ART

-03:00:00

America/Argentina/Jujuy

ART

-03:00:00

America/Argentina/La_Rioja

ART

-03:00:00

America/Argentina/Mendoza

ART

-03:00:00

America/Argentina/Rio_Gallegos

ART

-03:00:00

America/Argentina/Salta

ART

-03:00:00

America/Argentina/San_Juan

ART

-03:00:00

America/Argentina/San_Luis

ART

-03:00:00

America/Argentina/Tucuman

ART

-03:00:00

America/Argentina/Ushuaia

ART

-03:00:00

America/Aruba

AST

-04:00:00

America/Asuncion

PYST

-03:00:00

America/Atikokan

EST

-05:00:00

America/Atka

HAST

-10:00:00

America/Bahia

BRT

-03:00:00

America/Bahia_Banderas

CST

-06:00:00

America/Barbados

AST

-04:00:00

America/Belem

BRT

-03:00:00

America/Belize

CST

-06:00:00

America/Blanc-Sablon

AST

-04:00:00

America/Boa_Vista

AMT

-04:00:00

America/Bogota

COT

-05:00:00

America/Boise

MST

-07:00:00

America/Buenos_Aires

ART

-03:00:00

America/Cambridge_Bay

MST

-07:00:00

America/Campo_Grande

AMST

-03:00:00

America/Cancun

EST

-05:00:00

America/Caracas

VET

-04:30:00

America/Catamarca

ART

-03:00:00

America/Cayenne

GFT

-03:00:00

America/Cayman

EST

-05:00:00

America/Chicago

CST

-06:00:00

America/Chihuahua

MST

-07:00:00

America/Coral_Harbour

EST

-05:00:00

America/Cordoba

ART

-03:00:00

America/Costa_Rica

CST

-06:00:00

America/Creston

MST

-07:00:00

America/Cuiaba

AMST

-03:00:00

America/Curacao

AST

-04:00:00

America/Danmarkshavn

GMT

0:00:00

America/Dawson

PST

-08:00:00

America/Dawson_Creek

MST

-07:00:00

America/Denver

MST

-07:00:00

America/Detroit

EST

-05:00:00

America/Dominica

AST

-04:00:00

America/Edmonton

MST

-07:00:00

America/Eirunepe

ACT

-05:00:00

America/El_Salvador

CST

-06:00:00

America/Ensenada

PST

-08:00:00

America/Fortaleza

BRT

-03:00:00

America/Fort_Wayne

EST

-05:00:00

America/Glace_Bay

AST

-04:00:00

America/Godthab

WGT

-03:00:00

America/Goose_Bay

AST

-04:00:00

America/Grand_Turk

AST

-04:00:00

America/Grenada

AST

-04:00:00

America/Guadeloupe

AST

-04:00:00

America/Guatemala

CST

-06:00:00

America/Guayaquil

ECT

-05:00:00

America/Guyana

GYT

-04:00:00

America/Halifax

AST

-04:00:00

America/Havana

CST

-05:00:00

America/Hermosillo

MST

-07:00:00

America/Indiana/Indianapolis

EST

-05:00:00

America/Indiana/Knox

CST

-06:00:00

America/Indiana/Marengo

EST

-05:00:00

America/Indiana/Petersburg

EST

-05:00:00

America/Indiana/Tell_City

CST

-06:00:00

America/Indiana/Vevay

EST

-05:00:00

America/Indiana/Vincennes

EST

-05:00:00

America/Indiana/Winamac

EST

-05:00:00

America/Indianapolis

EST

-05:00:00

America/Inuvik

MST

-07:00:00

America/Iqaluit

EST

-05:00:00

America/Jamaica

EST

-05:00:00

America/Jujuy

ART

-03:00:00

America/Juneau

AKST

-09:00:00

America/Kentucky/Louisville

EST

-05:00:00

America/Kentucky/Monticello

EST

-05:00:00

America/Knox_IN

CST

-06:00:00

America/Kralendijk

AST

-04:00:00

America/La_Paz

BOT

-04:00:00

America/Lima

PET

-05:00:00

America/Los_Angeles

PST

-08:00:00

America/Louisville

EST

-05:00:00

America/Lower_Princes

AST

-04:00:00

America/Maceio

BRT

-03:00:00

America/Managua

CST

-06:00:00

America/Manaus

AMT

-04:00:00

America/Marigot

AST

-04:00:00

America/Martinique

AST

-04:00:00

America/Matamoros

CST

-06:00:00

America/Mazatlan

MST

-07:00:00

America/Mendoza

ART

-03:00:00

America/Menominee

CST

-06:00:00

America/Merida

CST

-06:00:00

America/Metlakatla

PST

-08:00:00

America/Mexico_City

CST

-06:00:00

America/Miquelon

PMST

-03:00:00

America/Moncton

AST

-04:00:00

America/Monterrey

CST

-06:00:00

America/Montevideo

UYST

-02:00:00

America/Montreal

EST

-05:00:00

America/Montserrat

AST

-04:00:00

America/Nassau

EST

-05:00:00

America/New_York

EST

-05:00:00

America/Nipigon

EST

-05:00:00

America/Nome

AKST

-09:00:00

America/Noronha

FNT

-02:00:00

America/North_Dakota/Beulah

CST

-06:00:00

America/North_Dakota/Center

CST

-06:00:00

America/North_Dakota/New_Salem

CST

-06:00:00

America/Ojinaga

MST

-07:00:00

America/Panama

EST

-05:00:00

America/Pangnirtung

EST

-05:00:00

America/Paramaribo

SRT

-03:00:00

America/Phoenix

MST

-07:00:00

America/Port-au-Prince

EST

-05:00:00

America/Porto_Acre

ACT

-05:00:00

America/Porto_Velho

AMT

-04:00:00

America/Port_of_Spain

AST

-04:00:00

America/Puerto_Rico

AST

-04:00:00

America/Rainy_River

CST

-06:00:00

America/Rankin_Inlet

CST

-06:00:00

America/Recife

BRT

-03:00:00

America/Regina

CST

-06:00:00

America/Resolute

CST

-06:00:00

America/Rio_Branco

ACT

-05:00:00

America/Rosario

ART

-03:00:00

America/Santarem

BRT

-03:00:00

America/Santa_Isabel

PST

-08:00:00

America/Santiago

CLT

-03:00:00

America/Santo_Domingo

AST

-04:00:00

America/Sao_Paulo

BRST

-02:00:00

America/Scoresbysund

EGT

-01:00:00

America/Shiprock

MST

-07:00:00

America/Sitka

AKST

-09:00:00

America/St_Barthelemy

AST

-04:00:00

America/St_Johns

NST

-03:30:00

America/St_Kitts

AST

-04:00:00

America/St_Lucia

AST

-04:00:00

America/St_Thomas

AST

-04:00:00

America/St_Vincent

AST

-04:00:00

America/Swift_Current

CST

-06:00:00

America/Tegucigalpa

CST

-06:00:00

America/Thule

AST

-04:00:00

America/Thunder_Bay

EST

-05:00:00

America/Tijuana

PST

-08:00:00

America/Toronto

EST

-05:00:00

America/Tortola

AST

-04:00:00

America/Vancouver

PST

-08:00:00

America/Virgin

AST

-04:00:00

America/Whitehorse

PST

-08:00:00

America/Winnipeg

CST

-06:00:00

America/Yakutat

AKST

-09:00:00

America/Yellowknife

MST

-07:00:00

Antarctica/Casey

AWST

8:00:00

Antarctica/Davis

DAVT

7:00:00

Antarctica/DumontDUrville

DDUT

10:00:00

Antarctica/Macquarie

MIST

11:00:00

Antarctica/Mawson

MAWT

5:00:00

Antarctica/McMurdo

NZDT

13:00:00

Antarctica/Palmer

CLT

-03:00:00

Antarctica/Rothera

ROTT

-03:00:00

Antarctica/South_Pole

NZDT

13:00:00

Antarctica/Syowa

SYOT

3:00:00

Antarctica/Troll

UTC

0:00:00

Antarctica/Vostok

VOST

6:00:00

Arctic/Longyearbyen

CET

1:00:00

Asia/Aden

AST

3:00:00

Asia/Almaty

ALMT

6:00:00

Asia/Amman

EET

2:00:00

Asia/Anadyr

ANAT

12:00:00

Asia/Aqtau

AQTT

5:00:00

Asia/Aqtobe

AQTT

5:00:00

Asia/Ashgabat

TMT

5:00:00

Asia/Ashkhabad

TMT

5:00:00

Asia/Baghdad

AST

3:00:00

Asia/Bahrain

AST

3:00:00

Asia/Baku

AZT

4:00:00

Asia/Bangkok

ICT

7:00:00

Asia/Beirut

EET

2:00:00

Asia/Bishkek

KGT

6:00:00

Asia/Brunei

BNT

8:00:00

Asia/Calcutta

IST

5:30:00

Asia/Chita

IRKT

8:00:00

Asia/Choibalsan

CHOT

8:00:00

Asia/Chongqing

CST

8:00:00

Asia/Chungking

CST

8:00:00

Asia/Colombo

IST

5:30:00

Asia/Dacca

BDT

6:00:00

Asia/Damascus

EET

2:00:00

Asia/Dhaka

BDT

6:00:00

Asia/Dili

TLT

9:00:00

Asia/Dubai

GST

4:00:00

Asia/Dushanbe

TJT

5:00:00

Asia/Gaza

EET

2:00:00

Asia/Harbin

CST

8:00:00

Asia/Hebron

EET

2:00:00

Asia/Hong_Kong

HKT

8:00:00

Asia/Hovd

HOVT

7:00:00

Asia/Ho_Chi_Minh

ICT

7:00:00

Asia/Irkutsk

IRKT

8:00:00

Asia/Istanbul

EET

2:00:00

Asia/Jakarta

WIB

7:00:00

Asia/Jayapura

WIT

9:00:00

Asia/Jerusalem

IST

2:00:00

Asia/Kabul

AFT

4:30:00

Asia/Kamchatka

PETT

12:00:00

Asia/Karachi

PKT

5:00:00

Asia/Kashgar

XJT

6:00:00

Asia/Kathmandu

NPT

5:45:00

Asia/Katmandu

NPT

5:45:00

Asia/Khandyga

YAKT

9:00:00

Asia/Kolkata

IST

5:30:00

Asia/Krasnoyarsk

KRAT

7:00:00

Asia/Kuala_Lumpur

MYT

8:00:00

Asia/Kuching

MYT

8:00:00

Asia/Kuwait

AST

3:00:00

Asia/Macao

CST

8:00:00

Asia/Macau

CST

8:00:00

Asia/Magadan

MAGT

10:00:00

Asia/Makassar

WITA

8:00:00

Asia/Manila

PHT

8:00:00

Asia/Muscat

GST

4:00:00

Asia/Nicosia

EET

2:00:00

Asia/Novokuznetsk

KRAT

7:00:00

Asia/Novosibirsk

NOVT

6:00:00

Asia/Omsk

OMST

6:00:00

Asia/Oral

ORAT

5:00:00

Asia/Phnom_Penh

ICT

7:00:00

Asia/Pontianak

WIB

7:00:00

Asia/Pyongyang

KST

9:00:00

Asia/Qatar

AST

3:00:00

Asia/Qyzylorda

QYZT

6:00:00

Asia/Rangoon

MMT

6:30:00

Asia/Riyadh

AST

3:00:00

Asia/Saigon

ICT

7:00:00

Asia/Sakhalin

SAKT

10:00:00

Asia/Samarkand

UZT

5:00:00

Asia/Seoul

KST

9:00:00

Asia/Shanghai

CST

8:00:00

Asia/Singapore

SGT

8:00:00

Asia/Srednekolymsk

SRET

11:00:00

Asia/Taipei

CST

8:00:00

Asia/Tashkent

UZT

5:00:00

Asia/Tbilisi

GET

4:00:00

Asia/Tehran

IRST

3:30:00

Asia/Tel_Aviv

IST

2:00:00

Asia/Thimbu

BTT

6:00:00

Asia/Thimphu

BTT

6:00:00

Asia/Tokyo

JST

9:00:00

Asia/Ujung_Pandang

WITA

8:00:00

Asia/Ulaanbaatar

ULAT

8:00:00

Asia/Ulan_Bator

ULAT

8:00:00

Asia/Urumqi

XJT

6:00:00

Asia/Ust-Nera

VLAT

10:00:00

Asia/Vientiane

ICT

7:00:00

Asia/Vladivostok

VLAT

10:00:00

Asia/Yakutsk

YAKT

9:00:00

Asia/Yekaterinburg

YEKT

5:00:00

Asia/Yerevan

AMT

4:00:00

Atlantic/Azores

AZOT

-01:00:00

Atlantic/Bermuda

AST

-04:00:00

Atlantic/Canary

WET

0:00:00

Atlantic/Cape_Verde

CVT

-01:00:00

Atlantic/Faeroe

WET

0:00:00

Atlantic/Faroe

WET

0:00:00

Atlantic/Jan_Mayen

CET

1:00:00

Atlantic/Madeira

WET

0:00:00

Atlantic/Reykjavik

GMT

0:00:00

Atlantic/South_Georgia

GST

-02:00:00

Atlantic/Stanley

FKST

-03:00:00

Atlantic/St_Helena

GMT

0:00:00

Australia/ACT

AEDT

11:00:00

Australia/Adelaide

ACDT

10:30:00

Australia/Brisbane

AEST

10:00:00

Australia/Broken_Hill

ACDT

10:30:00

Australia/Canberra

AEDT

11:00:00

Australia/Currie

AEDT

11:00:00

Australia/Darwin

ACST

9:30:00

Australia/Eucla

ACWST

8:45:00

Australia/Hobart

AEDT

11:00:00

Australia/LHI

LHDT

11:00:00

Australia/Lindeman

AEST

10:00:00

Australia/Lord_Howe

LHDT

11:00:00

Australia/Melbourne

AEDT

11:00:00

Australia/North

ACST

9:30:00

Australia/NSW

AEDT

11:00:00

Australia/Perth

AWST

8:00:00

Australia/Queensland

AEST

10:00:00

Australia/South

ACDT

10:30:00

Australia/Sydney

AEDT

11:00:00

Australia/Tasmania

AEDT

11:00:00

Australia/Victoria

AEDT

11:00:00

Australia/West

AWST

8:00:00

Australia/Yancowinna

ACDT

10:30:00

Brazil/Acre

ACT

-05:00:00

Brazil/DeNoronha

FNT

-02:00:00

Brazil/East

BRST

-02:00:00

Brazil/West

AMT

-04:00:00

Canada/Atlantic

AST

-04:00:00

Canada/Central

CST

-06:00:00

Canada/East-Saskatchewan

CST

-06:00:00

Canada/Eastern

EST

-05:00:00

Canada/Mountain

MST

-07:00:00

Canada/Newfoundland

NST

-03:30:00

Canada/Pacific

PST

-08:00:00

Canada/Saskatchewan

CST

-06:00:00

Canada/Yukon

PST

-08:00:00

CET

CET

1:00:00

Chile/Continental

CLT

-03:00:00

Chile/EasterIsland

EAST

-05:00:00

CST6CDT

CST

-06:00:00

Cuba

CST

-05:00:00

EET

EET

2:00:00

Egypt

EET

2:00:00

Eire

GMT

0:00:00

EST

EST

-05:00:00

EST5EDT

EST

-05:00:00


Etc/GMT

GMT

0:00:00


Etc/GMT+0

GMT

0:00:00


Etc/GMT+1

GMT+1

-01:00:00


Etc/GMT+10

GMT+10

-10:00:00


Etc/GMT+11

GMT+11

-11:00:00


Etc/GMT+12

GMT+12

-12:00:00


Etc/GMT+2

GMT+2

-02:00:00


Etc/GMT+3

GMT+3

-03:00:00


Etc/GMT+4

GMT+4

-04:00:00


Etc/GMT+5

GMT+5

-05:00:00


Etc/GMT+6

GMT+6

-06:00:00


Etc/GMT+7

GMT+7

-07:00:00


Etc/GMT+8

GMT+8

-08:00:00


Etc/GMT+9

GMT+9

-09:00:00


Etc/GMT-0

GMT

0:00:00


Etc/GMT-1

GMT-1

1:00:00


Etc/GMT-10

GMT-10

10:00:00


Etc/GMT-11

GMT-11

11:00:00


Etc/GMT-12

GMT-12

12:00:00


Etc/GMT-13

GMT-13

13:00:00


Etc/GMT-14

GMT-14

14:00:00


Etc/GMT-2

GMT-2

2:00:00


Etc/GMT-3

GMT-3

3:00:00


Etc/GMT-4

GMT-4

4:00:00


Etc/GMT-5

GMT-5

5:00:00


Etc/GMT-6

GMT-6

6:00:00


Etc/GMT-7

GMT-7

7:00:00


Etc/GMT-8

GMT-8

8:00:00


Etc/GMT-9

GMT-9

9:00:00


Etc/GMT0

GMT

0:00:00

Etc/Greenwich

GMT

0:00:00

Etc/UCT

UCT

0:00:00

Etc/Universal

UTC

0:00:00

Etc/UTC

UTC

0:00:00

Etc/Zulu

UTC

0:00:00

Europe/Amsterdam

CET

1:00:00

Europe/Andorra

CET

1:00:00

Europe/Athens

EET

2:00:00

Europe/Belfast

GMT

0:00:00

Europe/Belgrade

CET

1:00:00

Europe/Berlin

CET

1:00:00

Europe/Bratislava

CET

1:00:00

Europe/Brussels

CET

1:00:00

Europe/Bucharest

EET

2:00:00

Europe/Budapest

CET

1:00:00

Europe/Busingen

CET

1:00:00

Europe/Chisinau

EET

2:00:00

Europe/Copenhagen

CET

1:00:00

Europe/Dublin

GMT

0:00:00

Europe/Gibraltar

CET

1:00:00

Europe/Guernsey

GMT

0:00:00

Europe/Helsinki

EET

2:00:00

Europe/Isle_of_Man

GMT

0:00:00

Europe/Istanbul

EET

2:00:00

Europe/Jersey

GMT

0:00:00

Europe/Kaliningrad

EET

2:00:00

Europe/Kiev

EET

2:00:00

Europe/Lisbon

WET

0:00:00

Europe/Ljubljana

CET

1:00:00

Europe/London

GMT

0:00:00

Europe/Luxembourg

CET

1:00:00

Europe/Madrid

CET

1:00:00

Europe/Malta

CET

1:00:00

Europe/Mariehamn

EET

2:00:00

Europe/Minsk

MSK

3:00:00

Europe/Monaco

CET

1:00:00

Europe/Moscow

MSK

3:00:00

Europe/Nicosia

EET

2:00:00

Europe/Oslo

CET

1:00:00

Europe/Paris

CET

1:00:00

Europe/Podgorica

CET

1:00:00

Europe/Prague

CET

1:00:00

Europe/Riga

EET

2:00:00

Europe/Rome

CET

1:00:00

Europe/Samara

SAMT

4:00:00

Europe/San_Marino

CET

1:00:00

Europe/Sarajevo

CET

1:00:00

Europe/Simferopol

MSK

3:00:00

Europe/Skopje

CET

1:00:00

Europe/Sofia

EET

2:00:00

Europe/Stockholm

CET

1:00:00

Europe/Tallinn

EET

2:00:00

Europe/Tirane

CET

1:00:00

Europe/Tiraspol

EET

2:00:00

Europe/Uzhgorod

EET

2:00:00

Europe/Vaduz

CET

1:00:00

Europe/Vatican

CET

1:00:00

Europe/Vienna

CET

1:00:00

Europe/Vilnius

EET

2:00:00

Europe/Volgograd

MSK

3:00:00

Europe/Warsaw

CET

1:00:00

Europe/Zagreb

CET

1:00:00

Europe/Zaporozhye

EET

2:00:00

Europe/Zurich

CET

1:00:00

GB

GMT

0:00:00

GB-Eire

GMT

0:00:00

GMT

GMT

0:00:00

GMT+0

GMT

0:00:00

GMT-0

GMT

0:00:00

GMT0

GMT

0:00:00

Greenwich

GMT

0:00:00

Hongkong

HKT

8:00:00

HST

HST

-10:00:00

Iceland

GMT

0:00:00

Indian/Antananarivo

EAT

3:00:00

Indian/Chagos

IOT

6:00:00

Indian/Christmas

CXT

7:00:00

Indian/Cocos

CCT

6:30:00

Indian/Comoro

EAT

3:00:00

Indian/Kerguelen

TFT

5:00:00

Indian/Mahe

SCT

4:00:00

Indian/Maldives

MVT

5:00:00

Indian/Mauritius

MUT

4:00:00

Indian/Mayotte

EAT

3:00:00

Indian/Reunion

RET

4:00:00

Iran

IRST

3:30:00

Israel

IST

2:00:00

Jamaica

EST

-05:00:00

Japan

JST

9:00:00

Kwajalein

MHT

12:00:00

Libya

EET

2:00:00

MET

MET

1:00:00

Mexico/BajaNorte

PST

-08:00:00

Mexico/BajaSur

MST

-07:00:00

Mexico/General

CST

-06:00:00

MST

MST

-07:00:00

MST7MDT

MST

-07:00:00

Navajo

MST

-07:00:00

NZ

NZDT

13:00:00

NZ-CHAT

CHADT

13:45:00

Pacific/Apia

WSDT

14:00:00

Pacific/Auckland

NZDT

13:00:00

Pacific/Bougainville

BST

11:00:00

Pacific/Chatham

CHADT

13:45:00

Pacific/Chuuk

CHUT

10:00:00

Pacific/Easter

EAST

-05:00:00

Pacific/Efate

VUT

11:00:00

Pacific/Enderbury

PHOT

13:00:00

Pacific/Fakaofo

TKT

13:00:00

Pacific/Fiji

FJST

13:00:00

Pacific/Funafuti

TVT

12:00:00

Pacific/Galapagos

GALT

-06:00:00

Pacific/Gambier

GAMT

-09:00:00

Pacific/Guadalcanal

SBT

11:00:00

Pacific/Guam

ChST

10:00:00

Pacific/Honolulu

HST

-10:00:00

Pacific/Johnston

HST

-10:00:00

Pacific/Kiritimati

LINT

14:00:00

Pacific/Kosrae

KOST

11:00:00

Pacific/Kwajalein

MHT

12:00:00

Pacific/Majuro

MHT

12:00:00

Pacific/Marquesas

MART

-09:30:00

Pacific/Midway

SST

-11:00:00

Pacific/Nauru

NRT

12:00:00

Pacific/Niue

NUT

-11:00:00

Pacific/Norfolk

NFT

11:30:00

Pacific/Noumea

NCT

11:00:00

Pacific/Pago_Pago

SST

-11:00:00

Pacific/Palau

PWT

9:00:00

Pacific/Pitcairn

PST

-08:00:00

Pacific/Pohnpei

PONT

11:00:00

Pacific/Ponape

PONT

11:00:00

Pacific/Port_Moresby

PGT

10:00:00

Pacific/Rarotonga

CKT

-10:00:00

Pacific/Saipan

ChST

10:00:00

Pacific/Samoa

SST

-11:00:00

Pacific/Tahiti

TAHT

-10:00:00

Pacific/Tarawa

GILT

12:00:00

Pacific/Tongatapu

TOT

13:00:00

Pacific/Truk

CHUT

10:00:00

Pacific/Wake

WAKT

12:00:00

Pacific/Wallis

WFT

12:00:00

Pacific/Yap

CHUT

10:00:00

Poland

CET

1:00:00

Portugal

WET

0:00:00

PRC

CST

8:00:00

PST8PDT

PST

-08:00:00

ROC

CST

8:00:00

ROK

KST

9:00:00

Singapore

SGT

8:00:00

Turkey

EET

2:00:00

UCT

UCT

0:00:00

Universal

UTC

0:00:00

US/Alaska

AKST

-09:00:00

US/Aleutian

HAST

-10:00:00

US/Arizona

MST

-07:00:00

US/Central

CST

-06:00:00

US/East-Indiana

EST

-05:00:00

US/Eastern

EST

-05:00:00

US/Hawaii

HST

-10:00:00

US/Indiana-Starke

CST

-06:00:00

US/Michigan

EST

-05:00:00

US/Mountain

MST

-07:00:00

US/Pacific

PST

-08:00:00

US/Pacific-New

PST

-08:00:00

US/Samoa

SST

-11:00:00

UTC

UTC

0:00:00

W-SU

MSK

3:00:00

WET

WET

0:00:00

Zulu

UTC

0:00:00

你可能感兴趣的:(JAVA,PostgreSQL)