Skip to content

time: Parse fails with timezone names like AUSEDT #4838

@alexbrainman

Description

@alexbrainman
What steps will reproduce the problem?
1. run this

package main

import (
    "fmt"
    "log"
    "time"
)

func main() {
    t1 := time.Now()
    t2, err := time.Parse(time.RFC1123, t1.Format(time.RFC1123))
    if err != nil {
        log.Fatal(err)
    }
    fmt.Printf("t1=%v\nt2=%v\n", t1, t2)
}

What is the expected output?

Something like:

t1=2013-02-18 10:21:51.382931992 +1100 EST
t2=2013-02-18 10:21:51 +1100 EST

What do you see instead?

2013/02/18 10:22:10 parsing time "Mon, 18 Feb 2013 10:22:10 AUSEDT" as
"Mon, 02 Jan 2006 15:04:05 MST": cannot parse "AUSEDT" as
"MST"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions