time.Now() = 2009?

I get

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

with this code.

package main

import (
	"fmt"
	"time"
)

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

How do I get correct time? Fiddle

Running that code on the play ground will always result in a time close to that. It is how the sandbox there is set up to make results reproducible.

If you run the code locally it should give you correct date and time.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.