I understand how to parse times from strings using Golang.
Currently, I make a request in rails/ruby that is handled by Go, in which I pass in a time parameter.
This is what I'm doing in rails
resp = connection.get "url", {
updated_at: updated_at
}.compact
and updated_at
is Time.now - 1.day
.
In Go, this is how I'm parsing the time, after getting it out.
updatedAt, err := time.Parse("2006-01-02 15:04:05 -0700 MST", updatedAtVar)
The above works if time looks like
2014-11-17 23:02:03 +0000 UTC
but Ruby spits out a time that looks like
2016-08-10 22:29:51 +0000
which, when parsing results in
0001-01-01 00:00:00 +0000 UTC
What can I pass into my param such that go will parse the time correctly?