// Chapter 35 example: turning a time into text with Format. // Run with: go run exercises/35/03-format.go package main import ( "fmt" "time" ) func main() { t := time.Date(2025, time.August, 17, 14, 5, 9, 0, time.UTC) fmt.Println(t.Format("2006-01-02")) fmt.Println(t.Format("02/01/2006")) fmt.Println(t.Format("15:04")) fmt.Println(t.Format("3:04 PM")) fmt.Println(t.Format("2006-01-02 15:04:05")) fmt.Println(t.Format("Monday, 2 January 2006")) fmt.Println(t.Format("Mon 2 Jan")) // A common mistake: letters are not a layout. fmt.Println(t.Format("YYYY-MM-DD")) }