Skip to content

time: Parse date wrong? #12335

@xpbliss

Description

@xpbliss
aa:="2015-8-2" //or 2015-08-2, or 2015-8-02
t1, er1 := time.ParseInLocation("2006-01-02", aa, time.Local)
if er1 != nil {
    fmt.Println("parse date wrong!")            //it will be wrong.
}

but if the aa is "2015-08-02", it's ok.

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