Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A short script to print out all of the timezones from the pytz library
from datetime import datetime
from pytz import all_timezones, timezone
current_time =
print("timezone name, timezone code")
for timezone_name in all_timezones:
current_timezone = timezone(timezone_name)
timezone_code = current_timezone.tzname(current_time)
print(timezone_code + ", " + timezone_name)
timezone name, timezone code
GMT, Africa/Abidjan
GMT, Africa/Accra
EAT, Africa/Addis_Ababa
CET, Africa/Algiers
EAT, Africa/Asmara
EAT, Africa/Asmera
GMT, Africa/Bamako
WAT, Africa/Bangui
GMT, Africa/Banjul
GMT, Africa/Bissau
CAT, Africa/Blantyre
WAT, Africa/Brazzaville
CAT, Africa/Bujumbura
EET, Africa/Cairo
WET, Africa/Casablanca
CET, Africa/Ceuta
GMT, Africa/Conakry
GMT, Africa/Dakar
EAT, Africa/Dar_es_Salaam
EAT, Africa/Djibouti
WAT, Africa/Douala
WET, Africa/El_Aaiun
GMT, Africa/Freetown
CAT, Africa/Gaborone
CAT, Africa/Harare
SAST, Africa/Johannesburg
EAT, Africa/Juba
EAT, Africa/Kampala
EAT, Africa/Khartoum
CAT, Africa/Kigali
WAT, Africa/Kinshasa
WAT, Africa/Lagos
WAT, Africa/Libreville
GMT, Africa/Lome
WAT, Africa/Luanda
CAT, Africa/Lubumbashi
CAT, Africa/Lusaka
WAT, Africa/Malabo
CAT, Africa/Maputo
SAST, Africa/Maseru
SAST, Africa/Mbabane
EAT, Africa/Mogadishu
GMT, Africa/Monrovia
EAT, Africa/Nairobi
WAT, Africa/Ndjamena
WAT, Africa/Niamey
GMT, Africa/Nouakchott
GMT, Africa/Ouagadougou
WAT, Africa/Porto-Novo
GMT, Africa/Sao_Tome
GMT, Africa/Timbuktu
EET, Africa/Tripoli
CET, Africa/Tunis
WAST, Africa/Windhoek
HST, America/Adak
AKST, America/Anchorage
AST, America/Anguilla
AST, America/Antigua
BRT, America/Araguaina
ART, America/Argentina/Buenos_Aires
ART, America/Argentina/Catamarca
ART, America/Argentina/ComodRivadavia
ART, America/Argentina/Cordoba
ART, America/Argentina/Jujuy
ART, America/Argentina/La_Rioja
ART, America/Argentina/Mendoza
ART, America/Argentina/Rio_Gallegos
ART, America/Argentina/Salta
ART, America/Argentina/San_Juan
ART, America/Argentina/San_Luis
ART, America/Argentina/Tucuman
ART, America/Argentina/Ushuaia
AST, America/Aruba
PYST, America/Asuncion
EST, America/Atikokan
HST, America/Atka
BRT, America/Bahia
CST, America/Bahia_Banderas
AST, America/Barbados
BRT, America/Belem
CST, America/Belize
AST, America/Blanc-Sablon
AMT, America/Boa_Vista
COT, America/Bogota
MST, America/Boise
ART, America/Buenos_Aires
MST, America/Cambridge_Bay
AMST, America/Campo_Grande
EST, America/Cancun
VET, America/Caracas
ART, America/Catamarca
GFT, America/Cayenne
EST, America/Cayman
CST, America/Chicago
MST, America/Chihuahua
EST, America/Coral_Harbour
ART, America/Cordoba
CST, America/Costa_Rica
MST, America/Creston
AMST, America/Cuiaba
AST, America/Curacao
GMT, America/Danmarkshavn
PST, America/Dawson
MST, America/Dawson_Creek
MST, America/Denver
EST, America/Detroit
AST, America/Dominica
MST, America/Edmonton
ACT, America/Eirunepe
CST, America/El_Salvador
PST, America/Ensenada
MST, America/Fort_Nelson
EST, America/Fort_Wayne
BRT, America/Fortaleza
AST, America/Glace_Bay
WGT, America/Godthab
AST, America/Goose_Bay
AST, America/Grand_Turk
AST, America/Grenada
AST, America/Guadeloupe
CST, America/Guatemala
ECT, America/Guayaquil
GYT, America/Guyana
AST, America/Halifax
CST, America/Havana
MST, America/Hermosillo
EST, America/Indiana/Indianapolis
CST, America/Indiana/Knox
EST, America/Indiana/Marengo
EST, America/Indiana/Petersburg
CST, America/Indiana/Tell_City
EST, America/Indiana/Vevay
EST, America/Indiana/Vincennes
EST, America/Indiana/Winamac
EST, America/Indianapolis
MST, America/Inuvik
EST, America/Iqaluit
EST, America/Jamaica
ART, America/Jujuy
AKST, America/Juneau
EST, America/Kentucky/Louisville
EST, America/Kentucky/Monticello
CST, America/Knox_IN
AST, America/Kralendijk
BOT, America/La_Paz
PET, America/Lima
PST, America/Los_Angeles
EST, America/Louisville
AST, America/Lower_Princes
BRT, America/Maceio
CST, America/Managua
AMT, America/Manaus
AST, America/Marigot
AST, America/Martinique
CST, America/Matamoros
MST, America/Mazatlan
ART, America/Mendoza
CST, America/Menominee
CST, America/Merida
AKST, America/Metlakatla
CST, America/Mexico_City
PMST, America/Miquelon
AST, America/Moncton
CST, America/Monterrey
UYT, America/Montevideo
EST, America/Montreal
AST, America/Montserrat
EST, America/Nassau
EST, America/New_York
EST, America/Nipigon
AKST, America/Nome
FNT, America/Noronha
CST, America/North_Dakota/Beulah
CST, America/North_Dakota/Center
CST, America/North_Dakota/New_Salem
MST, America/Ojinaga
EST, America/Panama
EST, America/Pangnirtung
SRT, America/Paramaribo
MST, America/Phoenix
EST, America/Port-au-Prince
AST, America/Port_of_Spain
ACT, America/Porto_Acre
AMT, America/Porto_Velho
AST, America/Puerto_Rico
CST, America/Rainy_River
CST, America/Rankin_Inlet
BRT, America/Recife
CST, America/Regina
CST, America/Resolute
ACT, America/Rio_Branco
ART, America/Rosario
PST, America/Santa_Isabel
BRT, America/Santarem
CLT, America/Santiago
AST, America/Santo_Domingo
BRST, America/Sao_Paulo
EGT, America/Scoresbysund
MST, America/Shiprock
AKST, America/Sitka
AST, America/St_Barthelemy
NST, America/St_Johns
AST, America/St_Kitts
AST, America/St_Lucia
AST, America/St_Thomas
AST, America/St_Vincent
CST, America/Swift_Current
CST, America/Tegucigalpa
AST, America/Thule
EST, America/Thunder_Bay
PST, America/Tijuana
EST, America/Toronto
AST, America/Tortola
PST, America/Vancouver
AST, America/Virgin
PST, America/Whitehorse
CST, America/Winnipeg
AKST, America/Yakutat
MST, America/Yellowknife
AWST, Antarctica/Casey
DAVT, Antarctica/Davis
DDUT, Antarctica/DumontDUrville
MIST, Antarctica/Macquarie
MAWT, Antarctica/Mawson
NZDT, Antarctica/McMurdo
CLT, Antarctica/Palmer
ROTT, Antarctica/Rothera
NZDT, Antarctica/South_Pole
SYOT, Antarctica/Syowa
UTC, Antarctica/Troll
VOST, Antarctica/Vostok
CET, Arctic/Longyearbyen
AST, Asia/Aden
ALMT, Asia/Almaty
EET, Asia/Amman
ANAT, Asia/Anadyr
AQTT, Asia/Aqtau
AQTT, Asia/Aqtobe
TMT, Asia/Ashgabat
TMT, Asia/Ashkhabad
AST, Asia/Baghdad
AST, Asia/Bahrain
AZT, Asia/Baku
ICT, Asia/Bangkok
+07, Asia/Barnaul
EET, Asia/Beirut
KGT, Asia/Bishkek
BNT, Asia/Brunei
IST, Asia/Calcutta
YAKT, Asia/Chita
CHOT, Asia/Choibalsan
CST, Asia/Chongqing
CST, Asia/Chungking
IST, Asia/Colombo
BDT, Asia/Dacca
EET, Asia/Damascus
BDT, Asia/Dhaka
TLT, Asia/Dili
GST, Asia/Dubai
TJT, Asia/Dushanbe
EET, Asia/Gaza
CST, Asia/Harbin
EET, Asia/Hebron
ICT, Asia/Ho_Chi_Minh
HKT, Asia/Hong_Kong
HOVT, Asia/Hovd
IRKT, Asia/Irkutsk
EET, Asia/Istanbul
WIB, Asia/Jakarta
WIT, Asia/Jayapura
IST, Asia/Jerusalem
AFT, Asia/Kabul
PETT, Asia/Kamchatka
PKT, Asia/Karachi
XJT, Asia/Kashgar
NPT, Asia/Kathmandu
NPT, Asia/Katmandu
YAKT, Asia/Khandyga
IST, Asia/Kolkata
KRAT, Asia/Krasnoyarsk
MYT, Asia/Kuala_Lumpur
MYT, Asia/Kuching
AST, Asia/Kuwait
CST, Asia/Macao
CST, Asia/Macau
MAGT, Asia/Magadan
WITA, Asia/Makassar
PHT, Asia/Manila
GST, Asia/Muscat
EET, Asia/Nicosia
KRAT, Asia/Novokuznetsk
NOVT, Asia/Novosibirsk
OMST, Asia/Omsk
ORAT, Asia/Oral
ICT, Asia/Phnom_Penh
WIB, Asia/Pontianak
KST, Asia/Pyongyang
AST, Asia/Qatar
QYZT, Asia/Qyzylorda
MMT, Asia/Rangoon
AST, Asia/Riyadh
ICT, Asia/Saigon
SAKT, Asia/Sakhalin
UZT, Asia/Samarkand
KST, Asia/Seoul
CST, Asia/Shanghai
SGT, Asia/Singapore
SRET, Asia/Srednekolymsk
CST, Asia/Taipei
UZT, Asia/Tashkent
GET, Asia/Tbilisi
IRST, Asia/Tehran
IST, Asia/Tel_Aviv
BTT, Asia/Thimbu
BTT, Asia/Thimphu
JST, Asia/Tokyo
WITA, Asia/Ujung_Pandang
ULAT, Asia/Ulaanbaatar
ULAT, Asia/Ulan_Bator
XJT, Asia/Urumqi
VLAT, Asia/Ust-Nera
ICT, Asia/Vientiane
VLAT, Asia/Vladivostok
YAKT, Asia/Yakutsk
YEKT, Asia/Yekaterinburg
AMT, Asia/Yerevan
AZOT, Atlantic/Azores
AST, Atlantic/Bermuda
WET, Atlantic/Canary
CVT, Atlantic/Cape_Verde
WET, Atlantic/Faeroe
WET, Atlantic/Faroe
CET, Atlantic/Jan_Mayen
WET, Atlantic/Madeira
GMT, Atlantic/Reykjavik
GST, Atlantic/South_Georgia
GMT, Atlantic/St_Helena
FKST, Atlantic/Stanley
AEDT, Australia/ACT
ACDT, Australia/Adelaide
AEST, Australia/Brisbane
ACDT, Australia/Broken_Hill
AEDT, Australia/Canberra
AEDT, Australia/Currie
ACST, Australia/Darwin
ACWST, Australia/Eucla
AEDT, Australia/Hobart
LHDT, Australia/LHI
AEST, Australia/Lindeman
LHDT, Australia/Lord_Howe
AEDT, Australia/Melbourne
AEDT, Australia/NSW
ACST, Australia/North
AWST, Australia/Perth
AEST, Australia/Queensland
ACDT, Australia/South
AEDT, Australia/Sydney
AEDT, Australia/Tasmania
AEDT, Australia/Victoria
AWST, Australia/West
ACDT, Australia/Yancowinna
ACT, Brazil/Acre
FNT, Brazil/DeNoronha
BRST, Brazil/East
AMT, Brazil/West
AST, Canada/Atlantic
CST, Canada/Central
CST, Canada/East-Saskatchewan
EST, Canada/Eastern
MST, Canada/Mountain
NST, Canada/Newfoundland
PST, Canada/Pacific
CST, Canada/Saskatchewan
PST, Canada/Yukon
CLT, Chile/Continental
EAST, Chile/EasterIsland
CST, Cuba
EET, Egypt
GMT, Eire
GMT, Etc/GMT+0
GMT+1, Etc/GMT+1
GMT+10, Etc/GMT+10
GMT+11, Etc/GMT+11
GMT+12, Etc/GMT+12
GMT+2, Etc/GMT+2
GMT+3, Etc/GMT+3
GMT+4, Etc/GMT+4
GMT+5, Etc/GMT+5
GMT+6, Etc/GMT+6
GMT+7, Etc/GMT+7
GMT+8, Etc/GMT+8
GMT+9, Etc/GMT+9
GMT, Etc/GMT-0
GMT-1, Etc/GMT-1
GMT-10, Etc/GMT-10
GMT-11, Etc/GMT-11
GMT-12, Etc/GMT-12
GMT-13, Etc/GMT-13
GMT-14, Etc/GMT-14
GMT-2, Etc/GMT-2
GMT-3, Etc/GMT-3
GMT-4, Etc/GMT-4
GMT-5, Etc/GMT-5
GMT-6, Etc/GMT-6
GMT-7, Etc/GMT-7
GMT-8, Etc/GMT-8
GMT-9, Etc/GMT-9
GMT, Etc/Greenwich
UTC, Etc/Universal
UTC, Etc/Zulu
CET, Europe/Amsterdam
CET, Europe/Andorra
+04, Europe/Astrakhan
EET, Europe/Athens
GMT, Europe/Belfast
CET, Europe/Belgrade
CET, Europe/Berlin
CET, Europe/Bratislava
CET, Europe/Brussels
EET, Europe/Bucharest
CET, Europe/Budapest
CET, Europe/Busingen
EET, Europe/Chisinau
CET, Europe/Copenhagen
GMT, Europe/Dublin
CET, Europe/Gibraltar
GMT, Europe/Guernsey
EET, Europe/Helsinki
GMT, Europe/Isle_of_Man
EET, Europe/Istanbul
GMT, Europe/Jersey
EET, Europe/Kaliningrad
EET, Europe/Kiev
WET, Europe/Lisbon
CET, Europe/Ljubljana
GMT, Europe/London
CET, Europe/Luxembourg
CET, Europe/Madrid
CET, Europe/Malta
EET, Europe/Mariehamn
MSK, Europe/Minsk
CET, Europe/Monaco
MSK, Europe/Moscow
EET, Europe/Nicosia
CET, Europe/Oslo
CET, Europe/Paris
CET, Europe/Podgorica
CET, Europe/Prague
EET, Europe/Riga
CET, Europe/Rome
SAMT, Europe/Samara
CET, Europe/San_Marino
CET, Europe/Sarajevo
MSK, Europe/Simferopol
CET, Europe/Skopje
EET, Europe/Sofia
CET, Europe/Stockholm
EET, Europe/Tallinn
CET, Europe/Tirane
EET, Europe/Tiraspol
+04, Europe/Ulyanovsk
EET, Europe/Uzhgorod
CET, Europe/Vaduz
CET, Europe/Vatican
CET, Europe/Vienna
EET, Europe/Vilnius
MSK, Europe/Volgograd
CET, Europe/Warsaw
CET, Europe/Zagreb
EET, Europe/Zaporozhye
CET, Europe/Zurich
GMT, GB-Eire
GMT, Greenwich
HKT, Hongkong
GMT, Iceland
EAT, Indian/Antananarivo
IOT, Indian/Chagos
CXT, Indian/Christmas
CCT, Indian/Cocos
EAT, Indian/Comoro
TFT, Indian/Kerguelen
SCT, Indian/Mahe
MVT, Indian/Maldives
MUT, Indian/Mauritius
EAT, Indian/Mayotte
RET, Indian/Reunion
IRST, Iran
IST, Israel
EST, Jamaica
JST, Japan
MHT, Kwajalein
EET, Libya
PST, Mexico/BajaNorte
MST, Mexico/BajaSur
CST, Mexico/General
MST, Navajo
WSDT, Pacific/Apia
NZDT, Pacific/Auckland
BST, Pacific/Bougainville
CHADT, Pacific/Chatham
CHUT, Pacific/Chuuk
EAST, Pacific/Easter
VUT, Pacific/Efate
PHOT, Pacific/Enderbury
TKT, Pacific/Fakaofo
FJT, Pacific/Fiji
TVT, Pacific/Funafuti
GALT, Pacific/Galapagos
GAMT, Pacific/Gambier
SBT, Pacific/Guadalcanal
ChST, Pacific/Guam
HST, Pacific/Honolulu
HST, Pacific/Johnston
LINT, Pacific/Kiritimati
KOST, Pacific/Kosrae
MHT, Pacific/Kwajalein
MHT, Pacific/Majuro
MART, Pacific/Marquesas
SST, Pacific/Midway
NRT, Pacific/Nauru
NUT, Pacific/Niue
NFT, Pacific/Norfolk
NCT, Pacific/Noumea
SST, Pacific/Pago_Pago
PWT, Pacific/Palau
PST, Pacific/Pitcairn
PONT, Pacific/Pohnpei
PONT, Pacific/Ponape
PGT, Pacific/Port_Moresby
CKT, Pacific/Rarotonga
ChST, Pacific/Saipan
SST, Pacific/Samoa
TAHT, Pacific/Tahiti
GILT, Pacific/Tarawa
TOT, Pacific/Tongatapu
CHUT, Pacific/Truk
WAKT, Pacific/Wake
WFT, Pacific/Wallis
CHUT, Pacific/Yap
CET, Poland
WET, Portugal
SGT, Singapore
EET, Turkey
AKST, US/Alaska
HST, US/Aleutian
MST, US/Arizona
CST, US/Central
EST, US/East-Indiana
EST, US/Eastern
HST, US/Hawaii
CST, US/Indiana-Starke
EST, US/Michigan
MST, US/Mountain
PST, US/Pacific
PST, US/Pacific-New
SST, US/Samoa
UTC, Universal
UTC, Zulu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.