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 · 2 comments
Closed

Go Playground Has Wrong time.Now() #41626

tranmh opened this issue Sep 25, 2020 · 2 comments

Comments

@tranmh
Copy link

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 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 as completed Sep 25, 2020
@chrisharrisonkiwi
Copy link

Working as expected? :thisisfinememe:

@golang golang locked and limited conversation to collaborators Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants