List of acceptable Google Calendar api time zones - google-calendar-api
I'm working with Google's Calendar API, and I'm running into a bit of an issue. When I set the dateTime of an event I insert, I'm required to set the hour offset, but because o DST, it's off an hour. There is a property I can set for the calendar to set the timezone by name, which I would think would fix my problem, because Google would figure out the correct hour offset. However I do not know all of them, nor can I find a place that lists them. For example "America/Los_Angeles" or "Europe/Zurich". Anybody know where I can find them?
I think I have found the list that I was looking for on this website:
http://www.timezoneconverter.com/
Here is what I ended up needing:
America/New_York
America/Chicago
America/Denver
America/Los_Angeles
Specifically it was on this page
Comprehensive list of timezone names in JSON format
[
"Africa/Abidjan",
"Africa/Accra",
"Africa/Addis_Ababa",
"Africa/Algiers",
"Africa/Asmara",
"Africa/Asmera",
"Africa/Bamako",
"Africa/Bangui",
"Africa/Banjul",
"Africa/Bissau",
"Africa/Blantyre",
"Africa/Brazzaville",
"Africa/Bujumbura",
"Africa/Cairo",
"Africa/Casablanca",
"Africa/Ceuta",
"Africa/Conakry",
"Africa/Dakar",
"Africa/Dar_es_Salaam",
"Africa/Djibouti",
"Africa/Douala",
"Africa/El_Aaiun",
"Africa/Freetown",
"Africa/Gaborone",
"Africa/Harare",
"Africa/Johannesburg",
"Africa/Juba",
"Africa/Kampala",
"Africa/Khartoum",
"Africa/Kigali",
"Africa/Kinshasa",
"Africa/Lagos",
"Africa/Libreville",
"Africa/Lome",
"Africa/Luanda",
"Africa/Lubumbashi",
"Africa/Lusaka",
"Africa/Malabo",
"Africa/Maputo",
"Africa/Maseru",
"Africa/Mbabane",
"Africa/Mogadishu",
"Africa/Monrovia",
"Africa/Nairobi",
"Africa/Ndjamena",
"Africa/Niamey",
"Africa/Nouakchott",
"Africa/Ouagadougou",
"Africa/Porto-Novo",
"Africa/Sao_Tome",
"Africa/Timbuktu",
"Africa/Tripoli",
"Africa/Tunis",
"Africa/Windhoek",
"America/Adak",
"America/Anchorage",
"America/Anguilla",
"America/Antigua",
"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/Salta",
"America/Argentina/San_Juan",
"America/Argentina/San_Luis",
"America/Argentina/Tucuman",
"America/Argentina/Ushuaia",
"America/Aruba",
"America/Asuncion",
"America/Atikokan",
"America/Atka",
"America/Bahia",
"America/Bahia_Banderas",
"America/Barbados",
"America/Belem",
"America/Belize",
"America/Blanc-Sablon",
"America/Boa_Vista",
"America/Bogota",
"America/Boise",
"America/Buenos_Aires",
"America/Cambridge_Bay",
"America/Campo_Grande",
"America/Cancun",
"America/Caracas",
"America/Catamarca",
"America/Cayenne",
"America/Cayman",
"America/Chicago",
"America/Chihuahua",
"America/Coral_Harbour",
"America/Cordoba",
"America/Costa_Rica",
"America/Creston",
"America/Cuiaba",
"America/Curacao",
"America/Danmarkshavn",
"America/Dawson",
"America/Dawson_Creek",
"America/Denver",
"America/Detroit",
"America/Dominica",
"America/Edmonton",
"America/Eirunepe",
"America/El_Salvador",
"America/Ensenada",
"America/Fort_Nelson",
"America/Fort_Wayne",
"America/Fortaleza",
"America/Glace_Bay",
"America/Godthab",
"America/Goose_Bay",
"America/Grand_Turk",
"America/Grenada",
"America/Guadeloupe",
"America/Guatemala",
"America/Guayaquil",
"America/Guyana",
"America/Halifax",
"America/Havana",
"America/Hermosillo",
"America/Indiana/Indianapolis",
"America/Indiana/Knox",
"America/Indiana/Marengo",
"America/Indiana/Petersburg",
"America/Indiana/Tell_City",
"America/Indiana/Vevay",
"America/Indiana/Vincennes",
"America/Indiana/Winamac",
"America/Indianapolis",
"America/Inuvik",
"America/Iqaluit",
"America/Jamaica",
"America/Jujuy",
"America/Juneau",
"America/Kentucky/Louisville",
"America/Kentucky/Monticello",
"America/Knox_IN",
"America/Kralendijk",
"America/La_Paz",
"America/Lima",
"America/Los_Angeles",
"America/Louisville",
"America/Lower_Princes",
"America/Maceio",
"America/Managua",
"America/Manaus",
"America/Marigot",
"America/Martinique",
"America/Matamoros",
"America/Mazatlan",
"America/Mendoza",
"America/Menominee",
"America/Merida",
"America/Metlakatla",
"America/Mexico_City",
"America/Miquelon",
"America/Moncton",
"America/Monterrey",
"America/Montevideo",
"America/Montreal",
"America/Montserrat",
"America/Nassau",
"America/New_York",
"America/Nipigon",
"America/Nome",
"America/Noronha",
"America/North_Dakota/Beulah",
"America/North_Dakota/Center",
"America/North_Dakota/New_Salem",
"America/Ojinaga",
"America/Panama",
"America/Pangnirtung",
"America/Paramaribo",
"America/Phoenix",
"America/Port-au-Prince",
"America/Port_of_Spain",
"America/Porto_Acre",
"America/Porto_Velho",
"America/Puerto_Rico",
"America/Punta_Arenas",
"America/Rainy_River",
"America/Rankin_Inlet",
"America/Recife",
"America/Regina",
"America/Resolute",
"America/Rio_Branco",
"America/Rosario",
"America/Santa_Isabel",
"America/Santarem",
"America/Santiago",
"America/Santo_Domingo",
"America/Sao_Paulo",
"America/Scoresbysund",
"America/Shiprock",
"America/Sitka",
"America/St_Barthelemy",
"America/St_Johns",
"America/St_Kitts",
"America/St_Lucia",
"America/St_Thomas",
"America/St_Vincent",
"America/Swift_Current",
"America/Tegucigalpa",
"America/Thule",
"America/Thunder_Bay",
"America/Tijuana",
"America/Toronto",
"America/Tortola",
"America/Vancouver",
"America/Virgin",
"America/Whitehorse",
"America/Winnipeg",
"America/Yakutat",
"America/Yellowknife",
"Antarctica/Casey",
"Antarctica/Davis",
"Antarctica/DumontDUrville",
"Antarctica/Macquarie",
"Antarctica/Mawson",
"Antarctica/McMurdo",
"Antarctica/Palmer",
"Antarctica/Rothera",
"Antarctica/South_Pole",
"Antarctica/Syowa",
"Antarctica/Troll",
"Antarctica/Vostok",
"Arctic/Longyearbyen",
"Asia/Aden",
"Asia/Almaty",
"Asia/Amman",
"Asia/Anadyr",
"Asia/Aqtau",
"Asia/Aqtobe",
"Asia/Ashgabat",
"Asia/Ashkhabad",
"Asia/Atyrau",
"Asia/Baghdad",
"Asia/Bahrain",
"Asia/Baku",
"Asia/Bangkok",
"Asia/Barnaul",
"Asia/Beirut",
"Asia/Bishkek",
"Asia/Brunei",
"Asia/Calcutta",
"Asia/Chita",
"Asia/Choibalsan",
"Asia/Chongqing",
"Asia/Chungking",
"Asia/Colombo",
"Asia/Dacca",
"Asia/Damascus",
"Asia/Dhaka",
"Asia/Dili",
"Asia/Dubai",
"Asia/Dushanbe",
"Asia/Famagusta",
"Asia/Gaza",
"Asia/Harbin",
"Asia/Hebron",
"Asia/Ho_Chi_Minh",
"Asia/Hong_Kong",
"Asia/Hovd",
"Asia/Irkutsk",
"Asia/Istanbul",
"Asia/Jakarta",
"Asia/Jayapura",
"Asia/Jerusalem",
"Asia/Kabul",
"Asia/Kamchatka",
"Asia/Karachi",
"Asia/Kashgar",
"Asia/Kathmandu",
"Asia/Katmandu",
"Asia/Khandyga",
"Asia/Kolkata",
"Asia/Krasnoyarsk",
"Asia/Kuala_Lumpur",
"Asia/Kuching",
"Asia/Kuwait",
"Asia/Macao",
"Asia/Macau",
"Asia/Magadan",
"Asia/Makassar",
"Asia/Manila",
"Asia/Muscat",
"Asia/Nicosia",
"Asia/Novokuznetsk",
"Asia/Novosibirsk",
"Asia/Omsk",
"Asia/Oral",
"Asia/Phnom_Penh",
"Asia/Pontianak",
"Asia/Pyongyang",
"Asia/Qatar",
"Asia/Qostanay",
"Asia/Qyzylorda",
"Asia/Rangoon",
"Asia/Riyadh",
"Asia/Saigon",
"Asia/Sakhalin",
"Asia/Samarkand",
"Asia/Seoul",
"Asia/Shanghai",
"Asia/Singapore",
"Asia/Srednekolymsk",
"Asia/Taipei",
"Asia/Tashkent",
"Asia/Tbilisi",
"Asia/Tehran",
"Asia/Tel_Aviv",
"Asia/Thimbu",
"Asia/Thimphu",
"Asia/Tokyo",
"Asia/Tomsk",
"Asia/Ujung_Pandang",
"Asia/Ulaanbaatar",
"Asia/Ulan_Bator",
"Asia/Urumqi",
"Asia/Ust-Nera",
"Asia/Vientiane",
"Asia/Vladivostok",
"Asia/Yakutsk",
"Asia/Yangon",
"Asia/Yekaterinburg",
"Asia/Yerevan",
"Atlantic/Azores",
"Atlantic/Bermuda",
"Atlantic/Canary",
"Atlantic/Cape_Verde",
"Atlantic/Faeroe",
"Atlantic/Faroe",
"Atlantic/Jan_Mayen",
"Atlantic/Madeira",
"Atlantic/Reykjavik",
"Atlantic/South_Georgia",
"Atlantic/St_Helena",
"Atlantic/Stanley",
"Australia/ACT",
"Australia/Adelaide",
"Australia/Brisbane",
"Australia/Broken_Hill",
"Australia/Canberra",
"Australia/Currie",
"Australia/Darwin",
"Australia/Eucla",
"Australia/Hobart",
"Australia/LHI",
"Australia/Lindeman",
"Australia/Lord_Howe",
"Australia/Melbourne",
"Australia/NSW",
"Australia/North",
"Australia/Perth",
"Australia/Queensland",
"Australia/South",
"Australia/Sydney",
"Australia/Tasmania",
"Australia/Victoria",
"Australia/West",
"Australia/Yancowinna",
"Brazil/Acre",
"Brazil/DeNoronha",
"Brazil/East",
"Brazil/West",
"CET",
"CST6CDT",
"Canada/Atlantic",
"Canada/Central",
"Canada/Eastern",
"Canada/Mountain",
"Canada/Newfoundland",
"Canada/Pacific",
"Canada/Saskatchewan",
"Canada/Yukon",
"Chile/Continental",
"Chile/EasterIsland",
"Cuba",
"EET",
"EST",
"EST5EDT",
"Egypt",
"Eire",
"Etc/GMT",
"Etc/GMT+0",
"Etc/GMT+1",
"Etc/GMT+10",
"Etc/GMT+11",
"Etc/GMT+12",
"Etc/GMT+2",
"Etc/GMT+3",
"Etc/GMT+4",
"Etc/GMT+5",
"Etc/GMT+6",
"Etc/GMT+7",
"Etc/GMT+8",
"Etc/GMT+9",
"Etc/GMT-0",
"Etc/GMT-1",
"Etc/GMT-10",
"Etc/GMT-11",
"Etc/GMT-12",
"Etc/GMT-13",
"Etc/GMT-14",
"Etc/GMT-2",
"Etc/GMT-3",
"Etc/GMT-4",
"Etc/GMT-5",
"Etc/GMT-6",
"Etc/GMT-7",
"Etc/GMT-8",
"Etc/GMT-9",
"Etc/GMT0",
"Etc/Greenwich",
"Etc/UCT",
"Etc/UTC",
"Etc/Universal",
"Etc/Zulu",
"Europe/Amsterdam",
"Europe/Andorra",
"Europe/Astrakhan",
"Europe/Athens",
"Europe/Belfast",
"Europe/Belgrade",
"Europe/Berlin",
"Europe/Bratislava",
"Europe/Brussels",
"Europe/Bucharest",
"Europe/Budapest",
"Europe/Busingen",
"Europe/Chisinau",
"Europe/Copenhagen",
"Europe/Dublin",
"Europe/Gibraltar",
"Europe/Guernsey",
"Europe/Helsinki",
"Europe/Isle_of_Man",
"Europe/Istanbul",
"Europe/Jersey",
"Europe/Kaliningrad",
"Europe/Kiev",
"Europe/Kirov",
"Europe/Lisbon",
"Europe/Ljubljana",
"Europe/London",
"Europe/Luxembourg",
"Europe/Madrid",
"Europe/Malta",
"Europe/Mariehamn",
"Europe/Minsk",
"Europe/Monaco",
"Europe/Moscow",
"Europe/Nicosia",
"Europe/Oslo",
"Europe/Paris",
"Europe/Podgorica",
"Europe/Prague",
"Europe/Riga",
"Europe/Rome",
"Europe/Samara",
"Europe/San_Marino",
"Europe/Sarajevo",
"Europe/Saratov",
"Europe/Simferopol",
"Europe/Skopje",
"Europe/Sofia",
"Europe/Stockholm",
"Europe/Tallinn",
"Europe/Tirane",
"Europe/Tiraspol",
"Europe/Ulyanovsk",
"Europe/Uzhgorod",
"Europe/Vaduz",
"Europe/Vatican",
"Europe/Vienna",
"Europe/Vilnius",
"Europe/Volgograd",
"Europe/Warsaw",
"Europe/Zagreb",
"Europe/Zaporozhye",
"Europe/Zurich",
"GB",
"GB-Eire",
"GMT",
"GMT+0",
"GMT-0",
"GMT0",
"Greenwich",
"HST",
"Hongkong",
"Iceland",
"Indian/Antananarivo",
"Indian/Chagos",
"Indian/Christmas",
"Indian/Cocos",
"Indian/Comoro",
"Indian/Kerguelen",
"Indian/Mahe",
"Indian/Maldives",
"Indian/Mauritius",
"Indian/Mayotte",
"Indian/Reunion",
"Iran",
"Israel",
"Jamaica",
"Japan",
"Kwajalein",
"Libya",
"MET",
"MST",
"MST7MDT",
"Mexico/BajaNorte",
"Mexico/BajaSur",
"Mexico/General",
"NZ",
"NZ-CHAT",
"Navajo",
"PRC",
"PST8PDT",
"Pacific/Apia",
"Pacific/Auckland",
"Pacific/Bougainville",
"Pacific/Chatham",
"Pacific/Chuuk",
"Pacific/Easter",
"Pacific/Efate",
"Pacific/Enderbury",
"Pacific/Fakaofo",
"Pacific/Fiji",
"Pacific/Funafuti",
"Pacific/Galapagos",
"Pacific/Gambier",
"Pacific/Guadalcanal",
"Pacific/Guam",
"Pacific/Honolulu",
"Pacific/Johnston",
"Pacific/Kiritimati",
"Pacific/Kosrae",
"Pacific/Kwajalein",
"Pacific/Majuro",
"Pacific/Marquesas",
"Pacific/Midway",
"Pacific/Nauru",
"Pacific/Niue",
"Pacific/Norfolk",
"Pacific/Noumea",
"Pacific/Pago_Pago",
"Pacific/Palau",
"Pacific/Pitcairn",
"Pacific/Pohnpei",
"Pacific/Ponape",
"Pacific/Port_Moresby",
"Pacific/Rarotonga",
"Pacific/Saipan",
"Pacific/Samoa",
"Pacific/Tahiti",
"Pacific/Tarawa",
"Pacific/Tongatapu",
"Pacific/Truk",
"Pacific/Wake",
"Pacific/Wallis",
"Pacific/Yap",
"Poland",
"Portugal",
"ROC",
"ROK",
"Singapore",
"Turkey",
"UCT",
"US/Alaska",
"US/Aleutian",
"US/Arizona",
"US/Central",
"US/East-Indiana",
"US/Eastern",
"US/Hawaii",
"US/Indiana-Starke",
"US/Michigan",
"US/Mountain",
"US/Pacific",
"US/Pacific-New",
"US/Samoa",
"UTC",
"Universal",
"W-SU",
"WET",
"Zulu"
]
I grabbed from moment-timezone but these are based on ISO standards. Here is another example source from wikipedia: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones as well for cross reference.
All timezone for google cal
Pacific/Niue
Pacific/Pago_Pago
Pacific/Honolulu
Pacific/Rarotonga
Pacific/Tahiti
Pacific/Marquesas
America/Adak
Pacific/Gambier
America/Anchorage
America/Juneau
America/Metlakatla
America/Nome
America/Sitka
America/Yakutat
Pacific/Pitcairn
America/Dawson
America/Dawson_Creek
America/Creston
America/Whitehorse
America/Phoenix
America/Fort_Nelson
America/Vancouver
America/Los_Angeles
America/Tijuana
America/Hermosillo
Pacific/Galapagos
America/Boise
America/Denver
America/Inuvik
America/Yellowknife
America/Cambridge_Bay
America/Ojinaga
America/Edmonton
Pacific/Easter
America/Mazatlan
America/Chihuahua
America/Belize
America/Guatemala
America/Costa_Rica
America/Managua
America/Regina
America/El_Salvador
America/Swift_Current
America/Tegucigalpa
America/Rio_Branco
America/Eirunepe
America/Cancun
America/Atikokan
America/Panama
America/Jamaica
America/Bogota
America/Lima
America/Bahia_Banderas
America/North_Dakota/Beulah
America/Winnipeg
America/Matamoros
America/Menominee
America/Merida
America/Mexico_City
America/Monterrey
America/Indiana/Knox
America/North_Dakota/New_Salem
America/Rankin_Inlet
America/Resolute
America/Rainy_River
America/Indiana/Tell_City
America/North_Dakota/Center
America/Chicago
America/Guayaquil
America/Boa_Vista
America/Campo_Grande
America/Cuiaba
America/Manaus
America/Porto_Velho
America/Barbados
America/Blanc-Sablon
America/Curacao
America/Martinique
America/Port_of_Spain
America/Puerto_Rico
America/Santo_Domingo
America/La_Paz
America/Caracas
America/Indiana/Vevay
America/Indiana/Vincennes
America/Grand_Turk
America/Detroit
America/Iqaluit
America/Indiana/Indianapolis
America/Kentucky/Louisville
America/Indiana/Marengo
America/Kentucky/Monticello
America/Nassau
America/Nipigon
America/New_York
America/Pangnirtung
America/Indiana/Petersburg
America/Port-au-Prince
America/Thunder_Bay
America/Toronto
America/Indiana/Winamac
America/Guyana
America/Havana
America/Asuncion
America/Santiago
America/Argentina/Buenos_Aires
America/Argentina/Jujuy
America/Argentina/Catamarca
America/Argentina/Cordoba
America/Argentina/La_Rioja
America/Argentina/Mendoza
America/Argentina/Rio_Gallegos
America/Argentina/Salta
America/Argentina/San_Luis
America/Argentina/San_Juan
America/Argentina/Tucuman
America/Argentina/Ushuaia
Atlantic/Bermuda
America/Halifax
America/Glace_Bay
America/Goose_Bay
America/Moncton
America/Thule
America/Araguaina
America/Bahia
America/Belem
America/Maceio
America/Recife
America/Sao_Paulo
America/Santarem
America/Fortaleza
Antarctica/Palmer
America/Punta_Arenas
Antarctica/Rothera
America/Paramaribo
America/Montevideo
Atlantic/Stanley
America/Cayenne
America/St_Johns
America/Nuuk
America/Miquelon
America/Noronha
Atlantic/South_Georgia
Atlantic/Cape_Verde
Atlantic/Azores
America/Scoresbysund
UTC
Etc/GMT
Africa/Abidjan
Africa/Accra
Africa/Bissau
America/Danmarkshavn
Africa/Monrovia
Atlantic/Reykjavik
Africa/Sao_Tome
Europe/London
Africa/Lagos
Africa/Ndjamena
Atlantic/Canary
Europe/Lisbon
Atlantic/Madeira
Atlantic/Faroe
Africa/El_Aaiun
Europe/Dublin
Africa/Casablanca
Africa/Algiers
Africa/Tunis
Africa/Cairo
Europe/Kaliningrad
Africa/Tripoli
Antarctica/Troll
Africa/Windhoek
Africa/Juba
Africa/Maputo
Africa/Khartoum
Europe/Amsterdam
Europe/Andorra
Europe/Belgrade
Europe/Berlin
Europe/Brussels
Europe/Budapest
Europe/Warsaw
Europe/Vienna
Europe/Gibraltar
Europe/Copenhagen
Europe/Luxembourg
Europe/Madrid
Europe/Malta
Europe/Monaco
Europe/Oslo
Europe/Paris
Europe/Prague
Europe/Rome
Africa/Ceuta
Europe/Stockholm
Europe/Tirane
Europe/Zurich
Africa/Johannesburg
Europe/Volgograd
Africa/Nairobi
Asia/Amman
Europe/Athens
Asia/Beirut
Europe/Bucharest
Europe/Vilnius
Asia/Gaza
Asia/Damascus
Europe/Zaporozhye
Europe/Kiev
Europe/Chisinau
Asia/Nicosia
Europe/Riga
Europe/Sofia
Europe/Tallinn
Europe/Uzhgorod
Asia/Hebron
Europe/Helsinki
Asia/Jerusalem
Europe/Kirov
Europe/Minsk
Europe/Moscow
Europe/Simferopol
Asia/Baghdad
Asia/Qatar
Asia/Riyadh
Antarctica/Syowa
Europe/Istanbul
Asia/Famagusta
Asia/Baku
Asia/Yerevan
Europe/Astrakhan
Asia/Tbilisi
Indian/Mauritius
Asia/Dubai
Indian/Reunion
Europe/Samara
Europe/Saratov
Indian/Mahe
Europe/Ulyanovsk
Asia/Kabul
Asia/Tehran
Asia/Yekaterinburg
Asia/Aqtau
Asia/Aqtobe
Asia/Atyrau
Asia/Qyzylorda
Asia/Oral
Indian/Maldives
Antarctica/Mawson
Asia/Karachi
Asia/Dushanbe
Asia/Ashgabat
Asia/Samarkand
Asia/Tashkent
Indian/Kerguelen
Asia/Kolkata
Asia/Colombo
Asia/Kathmandu
Asia/Dhaka
Asia/Thimphu
Antarctica/Vostok
Asia/Almaty
Asia/Qostanay
Indian/Chagos
Asia/Bishkek
Asia/Omsk
Asia/Urumqi
Indian/Cocos
Asia/Yangon
Asia/Barnaul
Antarctica/Davis
Asia/Jakarta
Asia/Pontianak
Asia/Bangkok
Asia/Ho_Chi_Minh
Asia/Krasnoyarsk
Asia/Novokuznetsk
Asia/Novosibirsk
Indian/Christmas
Asia/Tomsk
Asia/Hovd
Asia/Brunei
Asia/Hong_Kong
Australia/Perth
Asia/Irkutsk
Asia/Macau
Asia/Shanghai
Asia/Kuala_Lumpur
Asia/Kuching
Asia/Singapore
Asia/Taipei
Asia/Ulaanbaatar
Asia/Choibalsan
Asia/Manila
Asia/Makassar
Australia/Eucla
Asia/Jayapura
Asia/Dili
Asia/Pyongyang
Asia/Seoul
Pacific/Palau
Asia/Khandyga
Asia/Chita
Asia/Yakutsk
Asia/Tokyo
Australia/Adelaide
Australia/Broken_Hill
Australia/Darwin
Asia/Vladivostok
Asia/Ust-Nera
Antarctica/Macquarie
Australia/Melbourne
Australia/Sydney
Australia/Hobart
Australia/Brisbane
Australia/Lindeman
Antarctica/DumontDUrville
Pacific/Port_Moresby
Pacific/Chuuk
Pacific/Guam
Australia/Lord_Howe
Pacific/Bougainville
Pacific/Efate
Antarctica/Casey
Pacific/Kosrae
Asia/Magadan
Pacific/Noumea
Pacific/Norfolk
Pacific/Pohnpei
Asia/Sakhalin
Pacific/Guadalcanal
Asia/Srednekolymsk
Asia/Anadyr
Pacific/Kwajalein
Pacific/Majuro
Pacific/Nauru
Pacific/Auckland
Pacific/Tarawa
Asia/Kamchatka
Pacific/Funafuti
Pacific/Wallis
Pacific/Wake
Pacific/Fiji
Pacific/Chatham
Pacific/Apia
Pacific/Enderbury
Pacific/Fakaofo
Pacific/Tongatapu
Pacific/Kiritimati
For modern browsers, you can get a list of available time zones with a single line of code:
Intl.supportedValuesOf('timeZone')
If you want the official list of values used by Google Calendar, check out the Time Zone Database, as provided in the reference.
Related
How to get a timezone string (a la "America/Los_Angeles" or "Pacific Standard Time") from a type Time with TZ info in Golang? [duplicate]
I have an UTC time and a time offset in seconds, and need to return the corresponding Go time value. It is trivial to instantiate the UTC time value by using the time.Unix() function. But to set the Zone, I need to determine the time.Location. How can I find the time.Location when knowing the UTC time and time offset ?
Without an actual entry to lookup in the time zone database, you can't know the true location for the time. If you want to work with just an offset, you can create a fixed location using time.FixedZone edt := time.FixedZone("EDT", -60*60*4) t, _ := time.ParseInLocation("02 Jan 06 15:04", "15 Sep 17 14:55", edt) fmt.Println(t) // 2017-09-15 14:55:00 -0400 EDT You can opt to specify a non-existent zone name, or none at all, as long as the output format you use doesn't require one. minus4 := time.FixedZone("", -60*60*4) t, _ = time.ParseInLocation("02 Jan 06 15:04", "15 Sep 17 14:55", minus4) fmt.Println(t.Format(time.RFC3339)) // 2017-09-15T14:55:00-04:00
Converting string like "2021-05-06 00:00:00 +0530 IST" to time.Time value
I have the following string 2021-05-06 00:00:00 +0530 IST that I need to convert to a time.Time value in golang. I know how to do it but I don't know what the layout should be to parse these type of strings. time, err := time.ParseInLocation("2021-05-06 00:00:00 +0530 IST", addedOn, loc) And this is giving me errors like "error":"parsing time \"2021-05-06 00:00:00 +0530 IST\" as \"2021-05-06 00:00:00 +0530 IST\": cannot parse \"-05-06 00:00:00 +0530 IST\" as \"1\"" So, what should be the correct layout for such strings?
You are putting the date in place of the time layout. See time#ParseInLocation func ParseInLocation(layout, value string, loc *Location) (Time, error) For instance: loc, _ := time.LoadLocation("Europe/Berlin") // This will look for the name CEST in the Europe/Berlin time zone. const longForm = "Jan 2, 2006 at 3:04pm (MST)" t, _ := time.ParseInLocation(longForm, "Jul 9, 2012 at 5:02am (CEST)", loc) fmt.Println(t) In your case: t , _ := time.ParseInLocation("2006-01-02 15:04:05 -0700 MST", "2021-05-06 00:00:00 +0530 IST", loc) See playground example (and other ParseInLocation examples here)
Layout 👇🏻 "2006-01-02 15:04:05 -0700 MST" Look at docs and examples PLAYGROUND
moment-timezone.js get utc offset for a specific date with timezone
I have users entering a date and a time zone (e.g. "America/Los Angeles") for that date and I'd like to convert that to UTC but to do that I need the utc offset for the time on that date. I can easily convert a date to the offset for the time zone if I already know the UTC date but I need the other way around... The utc offset can change depending on the date due to daylight saving so I need a way to enter a date and a timezone and get back the offset from UTC using that. Knowing the most recent switch from PST to PDT On march 11 at 2AM I tried using var tzOffset = moment.tz("3/11/2018 3:00 AM", "America/Los_Angeles").utcOffset(); document.write('utc offset is : ' + tzOffset + '<br/>') ; but that gives 480 when the correct answer is 420 I can get the correct answer 420 if I use parseZone like so: var tzOffset2 = moment.parseZone("3/11/2018 3:00 AM -07:00").utcOffset(); document.write('utc offset2 is : ' + tzOffset2 + '<br/>') ; but that means I need to already know the -7 offset that I'm trying to find... So how do I find the utcOffset for a specific date/time like "3/11/2018 3:00 AM" and timezone like "America/Los_Angeles"? Thanks
Your input is not in a ISO 8601 or RFC 2822 format recognized by moment(String), so you have to specify the format as second parameter using moment(String, String) (please note that, as docs states: The moment.tz constructor takes all the same arguments as the moment constructor, but uses the last argument as a time zone identifier.) Your code could be like the following: var tzOffset = moment.tz("3/11/2018 3:00 AM", "D/M/YYYY h:mm A", "America/Los_Angeles").utcOffset(); document.write('utc offset is : ' + tzOffset + '<br/>') ; <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.14/moment-timezone-with-data-2012-2022.min.js"></script>
how do you use the IF COMMAND to convert a date from 5/1/2017 to 05012017 in microsoft access?
how do you use the IF COMMAND to convert a date from 5/1/2017 to 05012017 in microsoft access?
You don't. Format is for this if month is May: TextDate = Format(YourDateValue, "mmddyyyy") or, if month is January: TextDate = Format(YourDateValue, "ddmmyyyy")
Creating a DateTime object with a specific UTC DateTime in PowerShell
I'm trying to create a DateTime object with a specific UTC timestamp in PowerShell. What's the simplest way to do this? I tried: Get-Date -Format (Get-Culture).DateTimeFormat.UniversalSortableDateTimePattern -Date "1970-01-01 00:00:00Z" but I get this output: 1969-12-31 19:00:00Z It's a few hours off. Where's my lapse in understanding?
The DateTime object itself is being created with the proper UTC time. But when PowerShell prints it out it converts it to my local culture and time zone, thus the difference. Proof: $UtcTime = Get-Date -Date "1970-01-01 00:00:00Z" $UtcTime.ToUniversalTime()
(get-date).ToUniversalTime().ToString("yyyyMMddTHHmmssfffffffZ")
$utctime = New-Object DateTime 1970, 1, 1, 0, 0, 0, ([DateTimeKind]::Utc) If you print out $utctime, then you get: 1. januar 1970 00:00:00 Also, $utctime.Kind is correctly set to Utc.
$time = [DateTime]::UtcNow | get-date -Format "yyyy-MM-ddTHH:mm:ssZ" This appears to also work
You can use the SpecifyKind method: PS C:\IT\s3> $timestamp Wednesday, July 18, 2018 7:57:14 PM PS C:\IT\s3> $timestamp.kind Unspecified PS C:\IT\s3> $utctimestamp = [DateTime]::SpecifyKind($timestamp,[DateTimeKind]::Utc) PS C:\IT\s3> $utctimestamp Wednesday, July 18, 2018 7:57:14 PM PS C:\IT\s3> $utctimestamp.kind Utc
This is how it works in .NET, right? PowerShell just calls the ToUniversalTime method. From http://msdn.microsoft.com/en-us/library/system.datetime.touniversaltime.aspx The Coordinated Universal Time (UTC) is equal to the local time minus the UTC offset. For more information about the UTC offset, see TimeZone.GetUtcOffset. The conversion also takes into account the daylight saving time rule that applies to the time represented by the current DateTime object.