Skip to content

time: timezone name heuristic in Parse rejects MSK and MSD #3790

@gopherbot

Description

@gopherbot

by k.shutemov:

I found that that current heuristic for parsing stdTZ is too strict:

go/src/pkg/time/format.go
 809                         if len(value) >= 3 && value[2] == 'T' {
 810                                 p, value = value[0:3], value[3:]
 811                         } else if len(value) >= 4 && value[3] == 'T' {
 812                                 p, value = value[0:4], value[4:]
 813                         } else {
 814                                 err = errBad
 815                                 break
 816                         }

As you can see it only accepts timezone names with 'T' at end. It's not
correct: "MSK" is a valid timezone name.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions