如何将日期从一种格式转换为另一种golang

I am converting a date into unix timestamp and fetching the date using split as follows

tm := time.Unix(1470009600, 0).UTC()
dateString := strings.Split(tm.String(), " ")

The output of dateString is 2016-07-15 i.e. YYYY-MM-DD format. How can I convert this into DD-MMM-YY format? eg: 15-Jul-16?

Use Format method with the appropriate format:

fmt.Println(tm.Format("02-Jan-06")) // Prints "01-Aug-16".

Playground: https://play.golang.org/p/uYDYzPwnbJ.