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

Go Playground Has Wrong time.Now() #41626

Closed
tranmh opened this issue Sep 25, 2020 · 1 comment
Closed

Go Playground Has Wrong time.Now() #41626

tranmh opened this issue Sep 25, 2020 · 1 comment

Comments

@tranmh
Copy link

@tranmh tranmh commented Sep 25, 2020

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

Not relevant

Does this issue reproduce with the latest release?

Not relevant

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

go env Output
Not relevant

What did you do?

https://play.golang.org/p/Z35Vf8gIg4Z

package main

import (
	"fmt"
	"time"
)

func main() {
	fmt.Println(time.Now())
}

What did you expect to see?

2020-09-25 10:35:00 +0000 UTC m=+0.000000001

What did you see instead?

2009-11-10 23:00:00 +0000 UTC m=+0.000000001

@ALTree
Copy link
Member

@ALTree ALTree commented Sep 25, 2020

Hi,

click the About button, it says (among other things):

In the playground the time begins at 2009-11-10 23:00:00 UTC (determining the significance of this date is an exercise for the reader). This makes it easier to cache programs by giving them deterministic output.

So this is working as expected. Closing here.

@ALTree ALTree closed this Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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