Skip to content

time.Parse should not require minutes for time zone #1026

@gopherbot

Description

@gopherbot

by an2048:

What steps will reproduce the problem?
    t, err := time.Parse("2006-01-02 15:04:05-07", "2010-08-13 01:23:45+02")
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(t)
    }

What is the expected output?
Fri Aug 13 01:23:45 +0200 2010

What do you see instead?
parsing time "2010-08-13 01:23:45+02" as "2006-01-02 15:04:05-07":
cannot parse "" as "-07"

What is your $GOOS?  $GOARCH?
Linux 386, Linux amd64

Which revision are you using?  (hg identify)
07d3a97302be release.2010-08-11/release

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