Go uses a reference date Mon Jan 2 15:04:05 MST 2006 (01/02 03:04:05PM '06 -0700) instead of format directives. Memorize it once.
Format with a layout — reference date
now := time.Date(2024, 3, 14, 15, 9, 26, 0, time.UTC)
fmt.Println(now.Format("2006-01-02 15:04:05"))
fmt.Println(now.Format(time.RFC3339))
Output
2024-03-14 15:09:26
2024-03-14T15:09:26Z
Parse — must match the layout exactly
t, err := time.Parse("2006-01-02", "2024-03-14")
fmt.Println(t, err)
Output
2024-03-14 00:00:00 +0000 UTC <nil>
Common built-in layouts
// time.RFC3339 = "2006-01-02T15:04:05Z07:00"
// time.DateOnly = "2006-01-02"
// time.TimeOnly = "15:04:05"
// time.DateTime = "2006-01-02 15:04:05"
// time.Kitchen = "3:04PM"