Skip to content

time: Parse does not handle negative years #7136

@gopherbot

Description

@gopherbot

by achun.SHX:

look this:

fmt.Println(time.Parse("2006", "-0001"))

output:

0001-01-01 00:00:00 +0000 UTC parsing time "-0001" as "2006": cannot
parse "-0001"

http://play.golang.org/p/noXxxdh6hR

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