mirror of
https://github.com/golang/go
synced 2024-11-17 23:14:49 -07:00
time: always use $GOROOT/lib/time/zoneinfo.zip with genzabbrs.go
genzabbrs.go uses whatever zoneinfo database available on the system. This makes genzabbrs.go output change from system to system. Adjust go:generate line to always use $GOROOT/lib/time/zoneinfo.zip, so it does not matter who runs the command. Also move go:generate line into zoneinfo.go, so it can be run on Unix (see #16368 for details). Fixes #15802. Change-Id: I8ae4818aaf40795364e180d7bb4326ad7c07c370 Reviewed-on: https://go-review.googlesource.com/27832 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
90c3cf4b52
commit
e2e2d10b9a
@ -9,6 +9,8 @@ import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
//go:generate env ZONEINFO=$GOROOT/lib/time/zoneinfo.zip go run genzabbrs.go -output zoneinfo_abbrs_windows.go
|
||||
|
||||
// A Location maps time instants to the zone in use at that time.
|
||||
// Typically, the Location represents the collection of time offsets
|
||||
// in use in a geographical area, such as CEST and CET for central Europe.
|
||||
|
@ -13,92 +13,106 @@ type abbr struct {
|
||||
}
|
||||
|
||||
var abbrs = map[string]abbr{
|
||||
"Egypt Standard Time": {"EET", "EET"}, // Africa/Cairo
|
||||
"Morocco Standard Time": {"WET", "WEST"}, // Africa/Casablanca
|
||||
"South Africa Standard Time": {"SAST", "SAST"}, // Africa/Johannesburg
|
||||
"W. Central Africa Standard Time": {"WAT", "WAT"}, // Africa/Lagos
|
||||
"E. Africa Standard Time": {"EAT", "EAT"}, // Africa/Nairobi
|
||||
"Libya Standard Time": {"EET", "EET"}, // Africa/Tripoli
|
||||
"Namibia Standard Time": {"WAT", "WAST"}, // Africa/Windhoek
|
||||
"Alaskan Standard Time": {"AKST", "AKDT"}, // America/Anchorage
|
||||
"Paraguay Standard Time": {"PYT", "PYST"}, // America/Asuncion
|
||||
"Bahia Standard Time": {"BRT", "BRT"}, // America/Bahia
|
||||
"SA Pacific Standard Time": {"COT", "COT"}, // America/Bogota
|
||||
"Argentina Standard Time": {"ART", "ART"}, // America/Buenos_Aires
|
||||
"Eastern Standard Time (Mexico)": {"EST", "EST"}, // America/Cancun
|
||||
"Venezuela Standard Time": {"VET", "VET"}, // America/Caracas
|
||||
"SA Eastern Standard Time": {"GFT", "GFT"}, // America/Cayenne
|
||||
"Central Standard Time": {"CST", "CDT"}, // America/Chicago
|
||||
"Mountain Standard Time (Mexico)": {"MST", "MDT"}, // America/Chihuahua
|
||||
"Central Brazilian Standard Time": {"AMT", "AMST"}, // America/Cuiaba
|
||||
"Mountain Standard Time": {"MST", "MDT"}, // America/Denver
|
||||
"Greenland Standard Time": {"WGT", "WGST"}, // America/Godthab
|
||||
"Central America Standard Time": {"CST", "CST"}, // America/Guatemala
|
||||
"Atlantic Standard Time": {"AST", "ADT"}, // America/Halifax
|
||||
"US Eastern Standard Time": {"EST", "EDT"}, // America/Indianapolis
|
||||
"SA Western Standard Time": {"BOT", "BOT"}, // America/La_Paz
|
||||
"Pacific Standard Time": {"PST", "PDT"}, // America/Los_Angeles
|
||||
"Central Standard Time (Mexico)": {"CST", "CDT"}, // America/Mexico_City
|
||||
"Montevideo Standard Time": {"UYT", "UYT"}, // America/Montevideo
|
||||
"Eastern Standard Time": {"EST", "EDT"}, // America/New_York
|
||||
"US Mountain Standard Time": {"MST", "MST"}, // America/Phoenix
|
||||
"Canada Central Standard Time": {"CST", "CST"}, // America/Regina
|
||||
"Pacific SA Standard Time": {"CLT", "CLST"}, // America/Santiago
|
||||
"E. South America Standard Time": {"BRT", "BRST"}, // America/Sao_Paulo
|
||||
"Newfoundland Standard Time": {"NST", "NDT"}, // America/St_Johns
|
||||
"Central Asia Standard Time": {"+06", "+06"}, // Asia/Almaty
|
||||
"Jordan Standard Time": {"EET", "EEST"}, // Asia/Amman
|
||||
"Arabic Standard Time": {"AST", "AST"}, // Asia/Baghdad
|
||||
"Azerbaijan Standard Time": {"AZT", "AZT"}, // Asia/Baku
|
||||
"SE Asia Standard Time": {"ICT", "ICT"}, // Asia/Bangkok
|
||||
"Altai Standard Time": {"+06", "+07"}, // Asia/Barnaul
|
||||
"Middle East Standard Time": {"EET", "EEST"}, // Asia/Beirut
|
||||
"India Standard Time": {"IST", "IST"}, // Asia/Calcutta
|
||||
"Transbaikal Standard Time": {"IRKT", "YAKT"}, // Asia/Chita
|
||||
"Sri Lanka Standard Time": {"IST", "IST"}, // Asia/Colombo
|
||||
"Syria Standard Time": {"EET", "EEST"}, // Asia/Damascus
|
||||
"Bangladesh Standard Time": {"BDT", "BDT"}, // Asia/Dhaka
|
||||
"Arabian Standard Time": {"GST", "GST"}, // Asia/Dubai
|
||||
"North Asia East Standard Time": {"IRKT", "IRKT"}, // Asia/Irkutsk
|
||||
"Israel Standard Time": {"IST", "IDT"}, // Asia/Jerusalem
|
||||
"Afghanistan Standard Time": {"AFT", "AFT"}, // Asia/Kabul
|
||||
"Russia Time Zone 11": {"PETT", "PETT"}, // Asia/Kamchatka
|
||||
"Pakistan Standard Time": {"PKT", "PKT"}, // Asia/Karachi
|
||||
"Nepal Standard Time": {"NPT", "NPT"}, // Asia/Katmandu
|
||||
"North Asia Standard Time": {"KRAT", "KRAT"}, // Asia/Krasnoyarsk
|
||||
"Magadan Standard Time": {"MAGT", "MAGT"}, // Asia/Magadan
|
||||
"N. Central Asia Standard Time": {"NOVT", "NOVT"}, // Asia/Novosibirsk
|
||||
"North Korea Standard Time": {"KST", "KST"}, // Asia/Pyongyang
|
||||
"Myanmar Standard Time": {"MMT", "MMT"}, // Asia/Rangoon
|
||||
"Arab Standard Time": {"AST", "AST"}, // Asia/Riyadh
|
||||
"Sakhalin Standard Time": {"SAKT", "SAKT"}, // Asia/Sakhalin
|
||||
"Korea Standard Time": {"KST", "KST"}, // Asia/Seoul
|
||||
"China Standard Time": {"CST", "CST"}, // Asia/Shanghai
|
||||
"Singapore Standard Time": {"SGT", "SGT"}, // Asia/Singapore
|
||||
"Russia Time Zone 10": {"SRET", "SRET"}, // Asia/Srednekolymsk
|
||||
"Taipei Standard Time": {"CST", "CST"}, // Asia/Taipei
|
||||
"West Asia Standard Time": {"UZT", "UZT"}, // Asia/Tashkent
|
||||
"Georgian Standard Time": {"GET", "GET"}, // Asia/Tbilisi
|
||||
"Iran Standard Time": {"IRST", "IRDT"}, // Asia/Tehran
|
||||
"Tokyo Standard Time": {"JST", "JST"}, // Asia/Tokyo
|
||||
"Ulaanbaatar Standard Time": {"ULAT", "ULAST"}, // Asia/Ulaanbaatar
|
||||
"Vladivostok Standard Time": {"VLAT", "VLAT"}, // Asia/Vladivostok
|
||||
"Yakutsk Standard Time": {"YAKT", "YAKT"}, // Asia/Yakutsk
|
||||
"Ekaterinburg Standard Time": {"YEKT", "YEKT"}, // Asia/Yekaterinburg
|
||||
"Caucasus Standard Time": {"AMT", "AMT"}, // Asia/Yerevan
|
||||
"Azores Standard Time": {"AZOT", "AZOST"}, // Atlantic/Azores
|
||||
"Cape Verde Standard Time": {"CVT", "CVT"}, // Atlantic/Cape_Verde
|
||||
"Greenwich Standard Time": {"GMT", "GMT"}, // Atlantic/Reykjavik
|
||||
"Cen. Australia Standard Time": {"ACST", "ACDT"}, // Australia/Adelaide
|
||||
"E. Australia Standard Time": {"AEST", "AEST"}, // Australia/Brisbane
|
||||
"AUS Central Standard Time": {"ACST", "ACST"}, // Australia/Darwin
|
||||
"Tasmania Standard Time": {"AEST", "AEDT"}, // Australia/Hobart
|
||||
"W. Australia Standard Time": {"AWST", "AWST"}, // Australia/Perth
|
||||
"AUS Eastern Standard Time": {"AEST", "AEDT"}, // Australia/Sydney
|
||||
"Egypt Standard Time": {"EET", "EET"}, // Africa/Cairo
|
||||
"Morocco Standard Time": {"WET", "WEST"}, // Africa/Casablanca
|
||||
"South Africa Standard Time": {"SAST", "SAST"}, // Africa/Johannesburg
|
||||
"W. Central Africa Standard Time": {"WAT", "WAT"}, // Africa/Lagos
|
||||
"E. Africa Standard Time": {"EAT", "EAT"}, // Africa/Nairobi
|
||||
"Libya Standard Time": {"EET", "EET"}, // Africa/Tripoli
|
||||
"Namibia Standard Time": {"WAT", "WAST"}, // Africa/Windhoek
|
||||
"Aleutian Standard Time": {"HST", "HDT"}, // America/Adak
|
||||
"Alaskan Standard Time": {"AKST", "AKDT"}, // America/Anchorage
|
||||
"Tocantins Standard Time": {"BRT", "BRT"}, // America/Araguaina
|
||||
"Paraguay Standard Time": {"PYT", "PYST"}, // America/Asuncion
|
||||
"Bahia Standard Time": {"BRT", "BRT"}, // America/Bahia
|
||||
"SA Pacific Standard Time": {"COT", "COT"}, // America/Bogota
|
||||
"Argentina Standard Time": {"ART", "ART"}, // America/Buenos_Aires
|
||||
"Eastern Standard Time (Mexico)": {"EST", "EST"}, // America/Cancun
|
||||
"Venezuela Standard Time": {"VET", "VET"}, // America/Caracas
|
||||
"SA Eastern Standard Time": {"GFT", "GFT"}, // America/Cayenne
|
||||
"Central Standard Time": {"CST", "CDT"}, // America/Chicago
|
||||
"Mountain Standard Time (Mexico)": {"MST", "MDT"}, // America/Chihuahua
|
||||
"Central Brazilian Standard Time": {"AMT", "AMST"}, // America/Cuiaba
|
||||
"Mountain Standard Time": {"MST", "MDT"}, // America/Denver
|
||||
"Greenland Standard Time": {"WGT", "WGST"}, // America/Godthab
|
||||
"Turks And Caicos Standard Time": {"AST", "AST"}, // America/Grand_Turk
|
||||
"Central America Standard Time": {"CST", "CST"}, // America/Guatemala
|
||||
"Atlantic Standard Time": {"AST", "ADT"}, // America/Halifax
|
||||
"Cuba Standard Time": {"CST", "CDT"}, // America/Havana
|
||||
"US Eastern Standard Time": {"EST", "EDT"}, // America/Indianapolis
|
||||
"SA Western Standard Time": {"BOT", "BOT"}, // America/La_Paz
|
||||
"Pacific Standard Time": {"PST", "PDT"}, // America/Los_Angeles
|
||||
"Central Standard Time (Mexico)": {"CST", "CDT"}, // America/Mexico_City
|
||||
"Saint Pierre Standard Time": {"PMST", "PMDT"}, // America/Miquelon
|
||||
"Montevideo Standard Time": {"UYT", "UYT"}, // America/Montevideo
|
||||
"Eastern Standard Time": {"EST", "EDT"}, // America/New_York
|
||||
"US Mountain Standard Time": {"MST", "MST"}, // America/Phoenix
|
||||
"Haiti Standard Time": {"EST", "EST"}, // America/Port-au-Prince
|
||||
"Canada Central Standard Time": {"CST", "CST"}, // America/Regina
|
||||
"Pacific SA Standard Time": {"CLT", "CLST"}, // America/Santiago
|
||||
"E. South America Standard Time": {"BRT", "BRST"}, // America/Sao_Paulo
|
||||
"Newfoundland Standard Time": {"NST", "NDT"}, // America/St_Johns
|
||||
"Pacific Standard Time (Mexico)": {"PST", "PDT"}, // America/Tijuana
|
||||
"Central Asia Standard Time": {"+06", "+06"}, // Asia/Almaty
|
||||
"Jordan Standard Time": {"EET", "EEST"}, // Asia/Amman
|
||||
"Arabic Standard Time": {"AST", "AST"}, // Asia/Baghdad
|
||||
"Azerbaijan Standard Time": {"AZT", "AZT"}, // Asia/Baku
|
||||
"SE Asia Standard Time": {"ICT", "ICT"}, // Asia/Bangkok
|
||||
"Altai Standard Time": {"+06", "+07"}, // Asia/Barnaul
|
||||
"Middle East Standard Time": {"EET", "EEST"}, // Asia/Beirut
|
||||
"India Standard Time": {"IST", "IST"}, // Asia/Calcutta
|
||||
"Transbaikal Standard Time": {"IRKT", "YAKT"}, // Asia/Chita
|
||||
"Sri Lanka Standard Time": {"IST", "IST"}, // Asia/Colombo
|
||||
"Syria Standard Time": {"EET", "EEST"}, // Asia/Damascus
|
||||
"Bangladesh Standard Time": {"BDT", "BDT"}, // Asia/Dhaka
|
||||
"Arabian Standard Time": {"GST", "GST"}, // Asia/Dubai
|
||||
"West Bank Standard Time": {"EET", "EEST"}, // Asia/Hebron
|
||||
"W. Mongolia Standard Time": {"HOVT", "HOVST"}, // Asia/Hovd
|
||||
"North Asia East Standard Time": {"IRKT", "IRKT"}, // Asia/Irkutsk
|
||||
"Israel Standard Time": {"IST", "IDT"}, // Asia/Jerusalem
|
||||
"Afghanistan Standard Time": {"AFT", "AFT"}, // Asia/Kabul
|
||||
"Russia Time Zone 11": {"PETT", "PETT"}, // Asia/Kamchatka
|
||||
"Pakistan Standard Time": {"PKT", "PKT"}, // Asia/Karachi
|
||||
"Nepal Standard Time": {"NPT", "NPT"}, // Asia/Katmandu
|
||||
"North Asia Standard Time": {"KRAT", "KRAT"}, // Asia/Krasnoyarsk
|
||||
"Magadan Standard Time": {"MAGT", "MAGT"}, // Asia/Magadan
|
||||
"N. Central Asia Standard Time": {"+06", "+07"}, // Asia/Novosibirsk
|
||||
"North Korea Standard Time": {"KST", "KST"}, // Asia/Pyongyang
|
||||
"Myanmar Standard Time": {"MMT", "MMT"}, // Asia/Rangoon
|
||||
"Arab Standard Time": {"AST", "AST"}, // Asia/Riyadh
|
||||
"Sakhalin Standard Time": {"SAKT", "SAKT"}, // Asia/Sakhalin
|
||||
"Korea Standard Time": {"KST", "KST"}, // Asia/Seoul
|
||||
"China Standard Time": {"CST", "CST"}, // Asia/Shanghai
|
||||
"Singapore Standard Time": {"SGT", "SGT"}, // Asia/Singapore
|
||||
"Russia Time Zone 10": {"SRET", "SRET"}, // Asia/Srednekolymsk
|
||||
"Taipei Standard Time": {"CST", "CST"}, // Asia/Taipei
|
||||
"West Asia Standard Time": {"UZT", "UZT"}, // Asia/Tashkent
|
||||
"Georgian Standard Time": {"GET", "GET"}, // Asia/Tbilisi
|
||||
"Iran Standard Time": {"IRST", "IRDT"}, // Asia/Tehran
|
||||
"Tokyo Standard Time": {"JST", "JST"}, // Asia/Tokyo
|
||||
"Tomsk Standard Time": {"+06", "+07"}, // Asia/Tomsk
|
||||
"Ulaanbaatar Standard Time": {"ULAT", "ULAST"}, // Asia/Ulaanbaatar
|
||||
"Vladivostok Standard Time": {"VLAT", "VLAT"}, // Asia/Vladivostok
|
||||
"Yakutsk Standard Time": {"YAKT", "YAKT"}, // Asia/Yakutsk
|
||||
"Ekaterinburg Standard Time": {"YEKT", "YEKT"}, // Asia/Yekaterinburg
|
||||
"Caucasus Standard Time": {"AMT", "AMT"}, // Asia/Yerevan
|
||||
"Azores Standard Time": {"AZOT", "AZOST"}, // Atlantic/Azores
|
||||
"Cape Verde Standard Time": {"CVT", "CVT"}, // Atlantic/Cape_Verde
|
||||
"Greenwich Standard Time": {"GMT", "GMT"}, // Atlantic/Reykjavik
|
||||
"Cen. Australia Standard Time": {"ACST", "ACDT"}, // Australia/Adelaide
|
||||
"E. Australia Standard Time": {"AEST", "AEST"}, // Australia/Brisbane
|
||||
"AUS Central Standard Time": {"ACST", "ACST"}, // Australia/Darwin
|
||||
"Aus Central W. Standard Time": {"ACWST", "ACWST"}, // Australia/Eucla
|
||||
"Tasmania Standard Time": {"AEST", "AEDT"}, // Australia/Hobart
|
||||
"Lord Howe Standard Time": {"LHST", "LHDT"}, // Australia/Lord_Howe
|
||||
"W. Australia Standard Time": {"AWST", "AWST"}, // Australia/Perth
|
||||
"AUS Eastern Standard Time": {"AEST", "AEDT"}, // Australia/Sydney
|
||||
"UTC": {"GMT", "GMT"}, // Etc/GMT
|
||||
"UTC-11": {"GMT+11", "GMT+11"}, // Etc/GMT+11
|
||||
"Dateline Standard Time": {"GMT+12", "GMT+12"}, // Etc/GMT+12
|
||||
"UTC-02": {"GMT+2", "GMT+2"}, // Etc/GMT+2
|
||||
"UTC-08": {"GMT+8", "GMT+8"}, // Etc/GMT+8
|
||||
"UTC-09": {"GMT+9", "GMT+9"}, // Etc/GMT+9
|
||||
"UTC+12": {"GMT-12", "GMT-12"}, // Etc/GMT-12
|
||||
"Astrakhan Standard Time": {"+03", "+04"}, // Europe/Astrakhan
|
||||
"W. Europe Standard Time": {"CET", "CEST"}, // Europe/Berlin
|
||||
@ -117,10 +131,15 @@ var abbrs = map[string]abbr{
|
||||
"Mauritius Standard Time": {"MUT", "MUT"}, // Indian/Mauritius
|
||||
"Samoa Standard Time": {"WSST", "WSDT"}, // Pacific/Apia
|
||||
"New Zealand Standard Time": {"NZST", "NZDT"}, // Pacific/Auckland
|
||||
"Bougainville Standard Time": {"BST", "BST"}, // Pacific/Bougainville
|
||||
"Chatham Islands Standard Time": {"CHAST", "CHADT"}, // Pacific/Chatham
|
||||
"Easter Island Standard Time": {"EAST", "EASST"}, // Pacific/Easter
|
||||
"Fiji Standard Time": {"FJT", "FJST"}, // Pacific/Fiji
|
||||
"Central Pacific Standard Time": {"SBT", "SBT"}, // Pacific/Guadalcanal
|
||||
"Hawaiian Standard Time": {"HST", "HST"}, // Pacific/Honolulu
|
||||
"Line Islands Standard Time": {"LINT", "LINT"}, // Pacific/Kiritimati
|
||||
"Marquesas Standard Time": {"MART", "MART"}, // Pacific/Marquesas
|
||||
"Norfolk Standard Time": {"NFT", "NFT"}, // Pacific/Norfolk
|
||||
"West Pacific Standard Time": {"PGT", "PGT"}, // Pacific/Port_Moresby
|
||||
"Tonga Standard Time": {"TOT", "TOT"}, // Pacific/Tongatapu
|
||||
}
|
||||
|
@ -11,8 +11,6 @@ import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
//go:generate go run genzabbrs.go -output zoneinfo_abbrs_windows.go
|
||||
|
||||
// TODO(rsc): Fall back to copy of zoneinfo files.
|
||||
|
||||
// BUG(brainman,rsc): On Windows, the operating system does not provide complete
|
||||
|
Loading…
Reference in New Issue
Block a user