package main import ( "fmt" "time" ) func main() { t, _ := time.ParseInLocation("2006-01-02 15:04:05", "2021-06-15 10:30:00", time.Local) fmt.Println(t) }
package main import ( "fmt" "time" ) func main() { layout := "Jan 2, 2006 at 3:04pm (MST)" t, _ := time.Parse(layout, "Jun 15, 2021 at 10:30am (CST)") fmt.Println(t) }In this code example, we are parsing a time string "Jun 15, 2021 at 10:30am (CST)" using "time.Parse" function and converting it into a time.Time type using "go time Time In" function. We are also setting the layout of the time string we are parsing. This code example uses the "time" package library as well. In conclusion, "go time Time In" function is used to convert a time string into a time.Time type. The package library used in both the above examples is the standard "time" library of Go.