t := time.Now() t = t.Truncate(time.Minute)
t := time.Now() t = t.Add(time.Hour) t = t.Truncate(time.Hour)
t := time.Now() t = t.Truncate(24 * time.Hour)In each example, we call `Truncate()` on a `Time` value and pass in a `Duration` argument to specify the granularity we want to round to. The resulting `Time` value will have any smaller units set to zero. Overall, the `time` package is a standard library package in Go that provides functionality for working with dates, times, and durations. Within this package, there are many useful methods and functions, including `Truncate()`, that can help you manipulate and format time values in various ways.