Answer the question
In order to leave comments, you need to log in
How to convert string to date in GOLANG?
Let's say I have a string dt:="2020-06-25". How can I convert it to a date type so that I can then, for example, do this:
dt1 := dt.Add(1 *time.Hour)
Answer the question
In order to leave comments, you need to log in
dt:="2020-06-25"
dt1, err := time.Parse("2006-01-02", dt)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question