Closed Leonardo-Boss closed 1 year ago
Context: https://go.dev/tour/flowcontrol/10
The server date is two days late so I doubt it's a time zone issue
evaluating this code in the server
package main import ( "fmt" "time" ) func main() { fmt.Println("When's Saturday?") today := time.Now().Weekday() fmt.Println(today) switch time.Saturday { case today + 0: fmt.Println("Today.") case today + 1: fmt.Println("Tomorrow.") case today + 2: fmt.Println("In two days.") default: fmt.Println("Too far away.") } }
results in:
When's Saturday? Tuesday Too far away.
running the same code on my local machine results in the correct date
When's Saturday? Thursday In two days.
closing because it's a duplicate of https://github.com/golang/tour/issues/1339
Context: https://go.dev/tour/flowcontrol/10
The server date is two days late so I doubt it's a time zone issue
evaluating this code in the server
results in:
running the same code on my local machine results in the correct date