Categories
How to convert string type to time?
there is a string with timestamp in it how can i just convert this string type to time type? so that it remains in the timestamp
Answer the question
In order to leave comments, you need to log in
package main import ( "fmt" "time" "strconv" ) func main() { i, err := strconv.ParseInt("1632896473", 10, 64) if err != nil { panic(err) } tm := time.Unix(i, 0) fmt.Println(tm.Unix()) }
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question