currentTime := time.Now() fmt.Println(currentTime)
currentTime := time.Now() formattedTime := currentTime.Format("2006-01-02 15:04:05") fmt.Println(formattedTime)
currentTime := time.Now() futureTime := currentTime.Add(time.Hour * 24) fmt.Println(futureTime)
dateString := "2021-10-01 12:30:00" parsedTime, _ := time.Parse("2006-01-02 15:04:05", dateString) fmt.Println(parsedTime)This code parses the string "2021-10-01 12:30:00" into a Time object and prints it to the console. Package: time Overall, the Go time package provides a powerful set of tools for working with time and date data in Go. Its functions can help with tasks such as creating and manipulating Time objects, parsing and formatting time strings, and calculating durations.