Parsing dates in Go

from blog lmno.lol @alvaro, | ↗ original
Ensure the reference time ("Mon Jan 2 15:04:05 -0700 MST 2006") is used in layout string. For example: package main import ( "fmt" "time" ) func main() { goodLayout := "January 2 2006" if t, err := time.Parse(goodLayout, "March 10 2019"); err != nil { fmt.Printf("%s\n", err) } else...