time.Time.UTC() Function in Golang with Examples
In Go language, time packages supplies functionality for determining as well as viewing time. The Time.UTC() function in Go language is used to yield “t” with the location that is set to UTC. Moreover, this function is defined under the time package. Here, you need to import the “time” package in order to use these functions.
func (t Time) UTC() Time
Here, “t” is the stated time in UTC.
Return Value: It returns t with the location that is set to UTC.
2020-11-15 21:23:32 +0000 UTC
2021-12-12 09:10:00 +0000 UTC
Here, the time “t” stated in the above code have values that are out of usual range but they are normalized while conversion.