Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time: RFC3339Nano returns different results of different OS. #28598

3timeslazy opened this issue Nov 5, 2018 · 1 comment

time: RFC3339Nano returns different results of different OS. #28598

3timeslazy opened this issue Nov 5, 2018 · 1 comment


Copy link

@3timeslazy 3timeslazy commented Nov 5, 2018

What version of Go are you using (go version)?

$ go version
go version go1.11.2 darwin/amd64

Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?

Mac OS:
- GOARCH="amd64"
- GOOS="darwin"

- GOARCH="amd64"
- GOOS="linux"

What did you do?

package main

import (

func main() {
	t := time.Date(2018, time.November, 5, 0, 54, 15, 5125, time.Local)

What did you expect to see?

I expect to see the same result on all OS. Ex. 2018-11-05T00:54:15.000005125+03:00

What did you see instead?

On Mac OS: 2018-11-05T00:54:15.000005125+03:00
On Linux: 2018-11-05T00:54:15.000005125Z

Copy link

@ianlancetaylor ianlancetaylor commented Nov 5, 2018

The Go standard library just takes the system's setting for time.Local. Your MacOS system is in +03:00, your GNU/Linux system is in UTC (or more likely simply unconfigured). This isn't something we can fix in Go.

@golang golang locked and limited conversation to collaborators Nov 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.