鍍金池/ 問答/GO/ 請問如何將CST時(shí)間轉(zhuǎn)換成當(dāng)前時(shí)間

請問如何將CST時(shí)間轉(zhuǎn)換成當(dāng)前時(shí)間

type Base struct {
    Id        uuid.UUID  `json:"id"`
    CreatedAt time.Time  `json:"created"`
    UpdatedAt time.Time  `json:"updated"`
    DeletedAt *time.Time `json:"deleted"`
}

"updated_at" = '2018-01-15T17:15:32+08:00'
//請問怎么把這個時(shí)間 去掉+08:00,這個是CST時(shí)間吧,找了很久,沒找到什么好方法
//轉(zhuǎn)換成下面這個
"updated_at" = '2018-01-15T17:15:32'
回答
編輯回答
尛曖昧

.Format("2006-01-02T15:04:05")

2017年4月5日 03:34
編輯回答
陌顏
package main

import (
    "fmt"
    "time"
)

func main() {
    fmt.Println(time.Now().Format("2006-01-02T15:03:04")) 
}

數(shù)字一個不能錯,go就是這么任性

2017年7月13日 06:45