Golang JSON Unmarshal MySQL datetime to time.Time

json.Unmarshal uses RFC3339 to decode MySQL datetime type into time.Time.

Json snippet

"Datetime": "2017-07-06T17:27:00Z"

Wrong

"Datetime": "2017-07-06 17:27:00"

or

"Datetime": "2017-07-06T17:27:00"

Reference

  1. json.Unmarshal uses RFC3339 to decode datetime but why mine is not working?

猜你喜欢

转载自blog.csdn.net/tianzhaixing/article/details/74591154
今日推荐