'timezone'에 해당되는 글 2건

  1. 2016.06.07 [AWS] JVM 타임존 설정 이슈
  2. 2011.11.07 Timezone Table.

[AWS] JVM 타임존 설정 이슈

ITWeb/개발일반 2016.06.07 14:52

aws 에서 인스턴스 생성 후 java program 에서 사용하던 Date 클래스에서의 시간이 잘 못 나오는 경우가 발생했습니다.

shell 에서 $ date 하면 정상적으로 KST 기준으로 시간이 잘 표시되지만 java application 에서는 GMT 0 로 시간이 표시 되는 문제 입니다.


해결 방법은 크게 두 가지 입니다.


1) 소스 코드에서 timezone 지정을 해서 date 설정을 하는 것입니다.

TimeZone timeZone;

Date date = new Date();

SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM.dd HH:mm");


timeZone = TimeZone.getTimeZone("Asia/Seoul");

simpleDateFormat.setTimeZone(timeZone);


LOG.debug("{}", simpleDateFormat.format(date));


2) 서버 인스턴스 상에서 timezone 설정을 다시 하는 것입니다.

$ sudo tzselect


5) Asia

...

23) Korea (South)

...

1) Yes

...


$ vi .profile

 

TZ='Asia/Seoul'

export TZ


- 우분투로 구성 하였기 때문에 timezone 구성은 위와 같이 진행 하였습니다.

저작자 표시 비영리 변경 금지
신고
Trackback 0 : Comment 0

Timezone Table.

ITWeb/개발일반 2011.11.07 11:22

[참고사이트]
http://time_zone.tripod.com/index.htm
http://www.datelib.de/Timezones.shtml


Country Country code Timezone
offset (hours)
Summertime
offset (hours)
Zone name
Afghanistan AF 4,5   Asia/Kabul
Albania AL 1 2 Europe/Tirane
Algeria DZ 1 2 Africa/Algiers
American Samoa AS -11   Pacific/Pago_Pago
Andorra AD 1 2 Europe/Andorra
Angola AO 1   Africa/Luanda
Anguilla AI -4   America/Anguilla
Antarctica AQ -2 -3  
Antigua & Barbuda AG -4   America/Antigua
Argentina AR -3    
Argentina western prov   -4    
Armenia AM 4 5 Asia/Yerevan
Aruba AW -4   America/Aruba
Ascension   0    
Australia Northern Territory AU 9,5   Australia/Darwin
Australia Lord Howe Island AU 10,5 11 Australia/Lord_Howe
Australia New South Wales AU 10 11  
Australia Queensland AU 10    
Australia Victoria AU 10 11 Australia/Melbourne
Australia Australian Captial Territory AU 10 11  
Australia South AU 9,5 10,5 Australia/Adelaide
Australia Tasmania AU 10 11 Australia/Hobart
Australia Western AU 8   Australia/Perth
Austria AT 1 2 Europe/Vienna
Azerbajian AZ 3   Asia/Baku
Azores PT -1 0 Atlantic/Azores
Bahamas BS -5 -4 America/Nassau
Bahrain BH 3   Asia/Bahrain
Balearic Islands   1 2  
Bangladesh BD 6   Asia/Dacca
Barbados BB -4   America/Barbados
Belarus BY 2 3 Europe/Minsk
Belgium BE 1 2 Europe/Brussels
Belize BZ -6   America/Belize
Benin BJ 1   Africa/Porto-Novo
Bermuda BM -4 -3 Atlantic/Bermuda
Bhutan BT 6   Asia/Thimbu
Bolivia BO -4   America/La_Paz
Bonaire   -4    
Bosnia Hercegovina BA 1 2 Europe/Sarajevo
Botswana BW 2   Africa/Gaborone
Brazil Acre BR -4 -5 America/Porto_Acre
Brazil Atlantic Islands BR -1 -2  
Brazil East BR -3 -1  
Brazil West BR -4 -3  
British Virgin Islands VG -4   America/Tortola
Brunei BN 8   Asia/Brunei
Bulgaria BG 2 3 Europe/Sofia
Burkina Faso BF 0   Africa/Ouagadougou
Burundi BI 2   Africa/Bujumbura
Cambodia KH 7   Asia/Phnom_Penh
Cameroon CM 1   Africa/Douala
Canada Central CA -6 -5  
Canada Eastern CA -5 -4  
Canada Mountain CA -7 -6  
Canada Yukon & Pacific CA -8 -7  
Canada Atlantic CA -4 -3  
Canada Newfoundland CA -3,5 -2,5 America/St_Johns
Canary Islands ES 0 1 Atlantic/Canary
Canton Enderbury Islands KI -11   Pacific/Enderbury
Cape Verde CV -1   Atlantic/Cape_Verde
Caroline Island   11    
Cayman Islands KY -5   America/Cayman
Central African Rep CF 1   Africa/Bangui
Chad TD 1   Africa/Ndjamena
Channel Islands   0 1  
Chatham Island NZ 12,75 13,75 Pacific/Chatham
Chile CL -4 -3 America/Santiago
China People's Rep CN 8    
Christmas Islands CX -10   Indian/Christmas
Colombia CO -5   America/Bogota
Congo CD/CG 1    
Cook Islands CK -10   Pacific/Rarotonga
Costa Rica CR -6   America/Costa_Rica
Cote d'Ivoire CI 0   Africa/Abidjan
Croatia HR 1 2 Europe/Zagreb
Cuba CU -5 -4 America/Havana
Curacao   -4    
Cyprus CY 2 3 Asia/Nicosia
Czech Republic CZ 1 2 Europe/Prague
Dahomey   1    
Denmark DK 1 2 Europe/Copenhagen
Djibouti DJ 3   Africa/Djibouti
Dominica DM -4   America/Dominica
Dominican Republic DO -4   America/Santo_Domingo
Easter Island CL -6 -5 Pacific/Easter
Ecuador EC -5   America/Guayaquil
Egypt EG 2 3 Africa/Cairo
El Salvador SV -6   America/El_Salvador
England GB 0 1 Europe/London
Equitorial Guinea GQ 1   Africa/Malabo
Eritrea ER 3   Africa/Asmera
Estonia EE 2 3 Europe/Tallinn
Ethiopia ET 3   Africa/Addis_Ababa
Falkland Islands FK -4 -3 Atlantic/Stanley
Faroe Island FO 0 1 Atlantic/Faeroe
Fiji FJ 12   Pacific/Fiji
Finland FI 2 3 Europe/Helsinki
France FR/FX 1 2 Europe/Paris
French Guiana GF -3   America/Cayenne
French Polynesia PF -10    
Gabon GA 1   Africa/Libreville
Galapagos Islands EC -5   Pacific/Galapagos
Gambia GM 0   Africa/Banjul
Gambier Island PF -9   Pacific/Gambier
Georgia GE 4   Asia/Tbilisi
Germany DE 1 2 Europe/Berlin
Ghana GH 0   Africa/Accra
Gibraltar GI 1 2 Europe/Gibraltar
Greece GR 2 3 Europe/Athens
Greenland GL -3 -2 America/Godthab
Greenland Thule GL -4 -3 America/Thule
Greenland Scoresbysun GL -1 0 America/Scoresbysund
Grenada GD -4   America/Grenada
Grenadines   -4    
Guadeloupe GP -4   America/Guadeloupe
Guam GU 10   Pacific/Guam
Guatemala GT -6   America/Guatemala
Guinea GN 0   Africa/Conakry
Guinea Bissau GW - 0 Africa/Bissau
Guyana GY -3   America/Guyana
Haiti HT -5 -4 America/Port-au-Prince
Honduras HN -6   America/Tegucigalpa
Hong kong CN 8   Asia/Hong_Kong
Hungary HU 1 2 Europe/Budapest
Iceland IS 0   Atlantic/Reykjavik
India IN 5,5   Asia/Calcutta
Indonesia Central ID 8    
Indonesia East ID 9    
Indonesia West ID 7    
Iran IR 3,5   Asia/Tehran
Iraq IQ 3 4 Asia/Baghdad
Ireland Republic of IE 0 1 Europe/Dublin
Israel IL 2 3 Asia/Jerusalem
Italy IT 1 2 Europe/Rome
Jamaica JM -5   America/Jamaica
Japan JP 9   Asia/Tokyo
Johnston Island UM -10   Pacific/Johnston
Jordan JO 2 3 Asia/Amman
Kazakhstan KZ 6 7  
Kenya KE 3   Africa/Nairobi
Kiribati KI 12    
Korea Dem Republic of KR 9   Asia/Seoul
Korea Republic of KP 9   Asia/Pyongyang
Kusaie   12    
Kuwait KW 3   Asia/Kuwait
Kwajalein MH -12   Pacific/Kwajalein
Kyrgyzstan   5 6  
Laos LA 7   Asia/Vientiane
Latvia LV 2 3 Europe/Riga
Lebanon LB 2 3 Asia/Beirut
Leeward Islands   -4    
Lesotho LS 2   Africa/Maseru
Liberia LR 0   Africa/Monrovia
Libya LY 2   Africa/Tripoli
Lithuania LT 2 3 Europe/Vilnius
Luxembourg LU 1 2 Europe/Luxembourg
Macedonia MK 1 2 Europe/Skopje
Madagascar MG 3   Indian/Antananarivo
Madeira PT 0 1 Atlantic/Madeira
Malawi MW 2   Africa/Blantyre
Malaysia MY 8   Asia/Kuala_Lumpur
Maldives MV 5   Indian/Maldives
Mali ML 0    
Mallorca Islands   1 2  
Malta MT 1 2 Europe/Malta
Mariana Island   10    
Marquesas Islands PF -9,5   Pacific/Marquesas
Marshall Islands MH 12   Pacific/Majuro
Martinique MQ -4   America/Martinique
Mauritania MR 0   Africa/Nouakchott
Mauritius MU 4   Indian/Mauritius
Mayotte YT 3   Indian/Mayotte
Melilla ES 1 2 Africa/Ceuta
Mexico MX -6    
Mexico Baja Calif Norte MX -8 -7  
Mexico Nayarit MX -7    
Mexico Sinaloa MX -7    
Mexico Sonora MX -7    
Midway Island UM -11   Pacific/Midway
Moldova MD 2 3 Europe/Chisinau
Moldovian Rep Pridnestrovye   2 3  
Monaco MC 1 2 Europe/Monaco
Mongolia MN 8   Asia/Ulan_Bator
Morocco MA 0   Africa/Casablanca
Mozambique MZ 2   Africa/Maputo
Myanmar (Burma) MM 6,5   Asia/Rangoon
Namibia NA 1 2 Africa/Windhoek
Nauru Republic of NR 12   Pacific/Nauru
Nepal NP 5,75   Asia/Katmandu
Netherlands NL 1 2 Europe/Amsterdam
Netherlands Antilles AN -4   America/Curacao
Nevis Montserrat MS -4   America/Montserrat
New Caledonia NC 11   Pacific/Noumea
New Hebrides   11    
New Zealand NZ 12 13 Pacific/Auckland
Nicaragua NI -6 -5 America/Managua
Niger NE 1   Africa/Niamey
Nigeria NG 1   Africa/Lagos
Niue Island NU -11   Pacific/Niue
Norfolk Island NF 11,5   Pacific/Norfolk
Northern Ireland GB 0 1 Europe/Belfast
Northern Mariana Islands MP 10   Pacific/Saipan
Norway NO 1 2 Europe/Oslo
Oman OM 4   Asia/Muscat
Pakistan PK 5   Asia/Karachi
Palau PW 9   Pacific/Palau
Panama PA -5   America/Panama
Papua New Guinea PG 10   Pacific/Port_Moresby
Paraguay PY -4 -3 America/Asuncion
Peru PE -5   America/Lima
Philippines PH 8   Asia/Manila
Pingelap   12    
Poland PL 1 2 Europe/Warsaw
Ponape Island FM 11   Pacific/Ponape
Portugal PT 1 2 Europe/Lisbon
Principe Island   0    
Puerto Rico PR -4   America/Puerto_Rico
Qatar QA 3   Asia/Qatar
Reunion RE 4   Indian/Reunion
Romania RO 2 3 Europe/Bucharest
Russian Federation zone eight RU 9 10  
Russian Federation zone eleven RU 12 13  
Russian Federation zone five RU 6 7  
Russian Federation zone four RU 5 6  
Russian Federation zone nine RU 10 11  
Russian Federation zone one RU 2 3  
Russian Federation zone seven RU 8 9  
Russian Federation zone six RU 7 8  
Russian Federation zone ten RU 11 12  
Russian Federation zone three RU 4 5  
Russian Federation zone two RU 4 5  
Rwanda RW 2   Africa/Kigali
Saba MY -4   Asia/Kuching
Samoa WS -11   Pacific/Apia
San Marino SM 1 2 Europe/San_Marino
Sao Tome e Principe ST 0   Africa/Sao_Tome
Saudi Arabia SA 3   Asia/Riyadh
Scotland   0 1  
Senegal SN 0   Africa/Dakar
Seychelles SC 4   Indian/Mahe
Sierra Leone SL 0   Africa/Freetown
Singapore SG 8   Asia/Singapore
Slovakia SK 1 2 Europe/Bratislava
Slovenia SI 1 2 Europe/Ljubljana
Society Island PF -10   Pacific/Tahiti
Solomon Islands SB 11   Pacific/Guadalcanal
Somalia SO 3   Africa/Mogadishu
South Africa ZA 2   Africa/Johannesburg
Spain ES 1 2 Europe/Madrid
Sri Lanka LK 5,5   Asia/Colombo
St Christopher   -4    
St Croix   -4    
St Helena SH 0   Atlantic/St_Helena
St John   -4    
St Kitts Nevis KN -4   America/St_Kitts
St Lucia LC -4   America/St_Lucia
St Maarten   -4    
St Pierre & Miquelon PM -3 -2 America/Miquelon
St Thomas   -4    
St Vincent VC -4   America/St_Vincent
Sudan SD 2   Africa/Khartoum
Suriname SR -3   America/Paramaribo
Swaziland SZ 2   Africa/Mbabane
Sweden SE 1 2 Europe/Stockholm
Switzerland CH 1 2 Europe/Zurich
Syria SY 2 3 Asia/Damascus
Tahiti   -10    
Taiwan TW 8   Asia/Taipei
Tajikistan TJ 6   Asia/Dushanbe
Tanzania TZ 3   Africa/Dar_es_Salaam
Thailand TH 7   Asia/Bangkok
Togo TG 0   Africa/Lome
Tonga TO 13   Pacific/Tongatapu
Trinidad and Tobago TT -4   America/Port_of_Spain
Tuamotu Island   -10    
Tubuai Island   -10    
Tunisia TN 1   Africa/Tunis
Turkey TR 2 3 Europe/Istanbul
Turkmenistan TM 5   Asia/Ashkhabad
Turks and Caicos Islands TC -5 -4 America/Grand_Turk
Tuvalu TV 12   Pacific/Funafuti
Uganda UG 3   Africa/Kampala
Ukraine UA 2 3  
United Arab Emirates AE 4   Asia/Dubai
United Kingdom GB 0 1 Europe/London
USA Central US -6 -5  
USA Eastern US -5 -4  
USA Mountain US -7 -6  
USA Arizona US -7   America/Phoenix
USA Indiana East US -5    
USA Pacific US -8 -7 America/Los_Angeles
USA Alaska US -9 -8  
USA Aleutian US -10   America/Adak
USA Hawaii US -10   Pacific/Honolulu
Uruguay UY -3   America/Montevideo
Uzbekistan UZ 5    
Vanuatu VU 11 12 Pacific/Efate
Vatican City VA 1 2 Europe/Vatican
Venezuela VE -4   America/Caracas
Vietnam VN 7   Asia/Saigon
Virgin Islands (US) VI -4   America/St_Thomas
Wake Island UM 12   Pacific/Wake
Wales GB 0 1 Europe/London
Wallis and Futuna Islands WF 12   Pacific/Wallis
Windward Islands   -4    
Yemen YE 3   Asia/Aden
Yugoslavia YU 1 2 Europe/Belgrade
Zaire Kasai   2    
Zaire Kinshasa Mbandaka CD 1   Africa/Kinshasa
Zaire Haut Zaire   2    
Zaire Kivu   2    
Zaire Shaba   2    
Zambia ZM 2   Africa/Lusaka
Zimbabwe ZW 2   Africa/Harare
Bouvet Island BV      
Cocos (Keeling) Islands CC     Indian/Cocos
Western Sahara EH     Africa/El_Aaiun
Micronesia FM      
South Georgia & the South Sandwich Islands GS     Atlantic/South_Georgia
Heard Island & McDonald Islands HM      
British Indian Ocean Territory IO     Indian/Chagos
Kirgizstan KG     Asia/Bishkek
Comoros KM     Indian/Comoro
Liechtenstein LI     Europe/Vaduz
Macao MO     Asia/Macao
Pitcairn PN     Pacific/Pitcairn
Palestine PS     Asia/Gaza
Svalbard & Jan Mayen SJ      
French Southern & Antarctic Lands TF     Indian/Kerguelen
Tokelau TK     Pacific/Fakaofo
East Timor TP      
US minor outlying islands UM      


신고
tags : timezone
Trackback 0 : Comment 0