Golang time.Parse()得到0001-01-01 00:00:00 +0000 UTC [重复]

This question already has an answer here:

This is my code:

t, _ := time.Parse("12/1/2015 12:00:00", "12/8/2015 12:00:00")
fmt.Println(t)

This is the result: 0001-01-01 00:00:00 +0000 UTC

How to get correct the date string?

Thanks!

</div>

You need to use the reference timestamp 2006-01-02 15:04:05 for the layout parameter (playground):

t, _ := time.Parse("1/2/2006 15:04:05", "12/8/2015 12:00:00")