]> Cypherpunks repositories - gostls13.git/commitdiff
time: MeST is a time zone name
authorRui Ueyama <ruiu@google.com>
Wed, 30 Apr 2014 15:30:36 +0000 (11:30 -0400)
committerRob Pike <r@golang.org>
Wed, 30 Apr 2014 15:30:36 +0000 (11:30 -0400)
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

src/pkg/time/format.go
src/pkg/time/format_test.go

index 555edd5cef01183ec23947ca9a99feb6de842b24..9f210ea27df199f97615c20becc84e903287f4b8 100644 (file)
@@ -1037,8 +1037,8 @@ func parseTimeZone(value string) (length int, ok bool) {
        if len(value) < 3 {
                return 0, false
        }
-       // Special case 1: This is the only zone with a lower-case letter.
-       if len(value) >= 4 && value[:4] == "ChST" {
+       // Special case 1: ChST and MeST are the only zones with a lower-case letter.
+       if len(value) >= 4 && (value[:4] == "ChST" || value[:4] == "MeST") {
                return 4, true
        }
        // Special case 2: GMT may have an hour offset; treat it specially.
index dd3f48ddc4910f44e561a2f0654a7e1ba025fc92..3bc8f42946c71287add22ffc282878b07f03c556 100644 (file)
@@ -331,6 +331,7 @@ var parseTimeZoneTests = []ParseTimeZoneTest{
        {"GMT-5 hi there", 5, true},
        {"GMT-51 hi there", 3, true},
        {"ChST hi there", 4, true},
+       {"MeST hi there", 4, true},
        {"MSDx", 3, true},
        {"MSDY", 0, false}, // four letters must end in T.
        {"ESAST hi", 5, true},