A unix_timestamp of 1405936049
corresponds to: 2014-07-21 09:47:29
. My goal is to derive the latter form from the timestamp.
After reading the format documentation, I came up with the following:
fmt.Println(time.Unix(1405936049, 0).Format("2006-01-02 15:04:05"))
which yields: 2014-07-21 02:47:29
, which makes sense, since time.Unix(1405936049, 0)
gives: 2014-07-21 02:47:29 -0700 PDT
(to be clear, I want: 2014-07-21 09:47:29, the hour is incorrect).
I'm sure if I knew the correct terminology, I'd be able to find a solution in the documentation, but at this point, I'm uncertain how to tell the parser to account for -0700
or perhaps an alternative solution would be to use something besides time.Unix()
, so that the resulting time would have already accounted for the hour difference? Any help would be appreciated.