In Go language, time packages supplies functionality for determining as well as viewing time. The Time.Location() function in Go language is used to check the data of the time zone that is associated with “t”. 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) Location() *Location
Here, “t” is the stated time and *Location is the pointer to Location.
Return value: It returns the information of the time zone that is associated with “t”.
Here, FixedZone() method is used in order to define the location parameter of Date() method so the data of the time zone in the output is returned according to that location.