time.FixedZone() Function in Golang With Examples
In Go language, time packages supplies functionality for determining as well as viewing time. The FixedZone() function in Go language is used to find a location that constantly uses the stated name of the zone and offset (i.e, seconds east of 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 FixedZone(name string, offset int) *Location
Here, “name” is the name of the zone, offset holds an integer and *Location is the pointer to the Location. Where “Location” forms the set of time offsets in use.
Return Value: It returns the location that constantly uses the stated zone name and offset.
Here, the stated location is returned.
2020-04-06 09:55:06 -0240 UTC-6
Here, at first FixedZone() method is called then Date() method is called with its parameters i.e, date, time, and location and then all these parameters are returned as output.