Commit 70f6c430 authored by Rui Ueyama's avatar Rui Ueyama Committed by Rob Pike

time: MeST is a time zone name

Not only ChST but also MeST (America/Metlakatla) is a zone
name containing a lower case letter.

LGTM=robert.hencke, r
R=golang-codereviews, robert.hencke, bradfitz, r
CC=golang-codereviews
https://golang.org/cl/99910043
parent ace8bc35
...@@ -1037,8 +1037,8 @@ func parseTimeZone(value string) (length int, ok bool) { ...@@ -1037,8 +1037,8 @@ func parseTimeZone(value string) (length int, ok bool) {
if len(value) < 3 { if len(value) < 3 {
return 0, false return 0, false
} }
// Special case 1: This is the only zone with a lower-case letter. // Special case 1: ChST and MeST are the only zones with a lower-case letter.
if len(value) >= 4 && value[:4] == "ChST" { if len(value) >= 4 && (value[:4] == "ChST" || value[:4] == "MeST") {
return 4, true return 4, true
} }
// Special case 2: GMT may have an hour offset; treat it specially. // Special case 2: GMT may have an hour offset; treat it specially.
......
...@@ -331,6 +331,7 @@ var parseTimeZoneTests = []ParseTimeZoneTest{ ...@@ -331,6 +331,7 @@ var parseTimeZoneTests = []ParseTimeZoneTest{
{"GMT-5 hi there", 5, true}, {"GMT-5 hi there", 5, true},
{"GMT-51 hi there", 3, true}, {"GMT-51 hi there", 3, true},
{"ChST hi there", 4, true}, {"ChST hi there", 4, true},
{"MeST hi there", 4, true},
{"MSDx", 3, true}, {"MSDx", 3, true},
{"MSDY", 0, false}, // four letters must end in T. {"MSDY", 0, false}, // four letters must end in T.
{"ESAST hi", 5, true}, {"ESAST hi", 5, true},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment