Golang时间。解析定义新格式类型[重复]

This question already has an answer here:

I am trying to parse a date of the format "2017/02/28 17:07:54". I am using the time.Parse method.

playground example: https://play.golang.org/p/B_hnws1AGv

This is failing. It produces a time object: 0001-01-01 00:00:00 +0000 UTC (which clearly is not the date I am trying to parse).

How can I parse a date of this format? My end goal is to convert "2017/02/28 17:07:54" to "Feb 28" Note that I do not want "February 28" I want "Feb 28."

I have looked at the following links:

</div>

Your format string is using the wrong reference date (2006-01-02 15:04:05). It should be the following:

const longForm2 = "2006/01/02 15:04:05"