I am trying to take a string and convert that string into ISO8601 timestamp format using Go.
I read a few StackOverflow posts and tried them, none of them worked for me. I might be doing it wrong?
My datetime string is something like
date := "8/16/2019 8:01:35 PM"
func main() {
date := "8/16/2019 8:01:35 PM"
t, _ := time.Parse("6/16/2019 3:07:53 PM", date)
fmt.Println(t) // getting 0001-01-01 00:00:00 +0000 UTC
}
I am expecting to get a parsed DateTime value which is something like 2019-8-16T20:01:35
from the above code and then convert it to ISO8601 format, like 2019-8-16T20:01:35.000Z
as an end result.