Answers for "golang string to time"

Go
2

golang string to time

layout := "2006-01-02T15:04:05.000Z"
str := "2014-11-12T11:45:26.371Z"
t, err := time.Parse(layout, str)

if err != nil {
    fmt.Println(err)
}
fmt.Println(t)
Posted by: Guest on August-18-2021

Browse Popular Code Answers by Language