Convert time.Time to string
问题 I'm trying to add some values from my database to a []string in Go. Some of these are timestamps. I get the error: cannot use U.Created_date (type time.Time) as type string in array element Can I convert time.Time to string ? type UsersSession struct { Userid int Timestamp time.Time Created_date time.Time } type Users struct { Name string Email string Country string Created_date time.Time Id int Hash string IP string } - var usersArray = [][]string{} rows, err := db.Query("SELECT u.id, u.hash