I may have missed something, but on my local system, everything behaves as expected, but in the container, something seems off
main.go
package main
import (
"fmt"
"time"
)
func main() {
t, err := time.Parse(time.RFC1123, "Fri, 22 Jun 2018 13:00:00 KST")
if err != nil {
panic(err)
}
fmt.Println(t.String())
fmt.Println(t.UTC().String())
fmt.Println(t.UTC().Equal(t))
}
Dockerfile
FROM golang:latest
COPY main.go /go/src/test/main.go
WORKDIR /go/src/test
CMD go run main.go
On my local system, the output from this program is:
2018-06-22 13:00:00 +0900 KST
2018-06-22 04:00:00 +0000 UTC
true
but if I build and run it in a container I get this:
2018-06-22 13:00:00 +0000 KST
2018-06-22 13:00:00 +0000 UTC
true
which seems to be converting the timezone to UTC, but it is not changing they time so they are not equal