Note: If you are interested in learning Golang, then for that we have a golang comprehensive tutorial series. Do check it out – Golang Comprehensive Tutorial Series. Now let’s see the current tutorial….
Author: admin
Date in Go (Golang)
Date in Go is represented using time.Time struct only. There is no separate Date struct in Go. time.Date function can be used to construct a date. This function returns the time which…
Convert Unix TimeStamp to time.Time in Go (Golang)
Time can be represented in GO in both time.Time and Unix Timestamp format. The Unix Timestamp also known as Epoch Time is the number of seconds elapsed since 00:00:00 UTC on 1 January…
Add or Subtract to time in Go (Golang)
Overview time package in golang defines two ways of adding or subtracting to a time. Add function – It is used to add/subtract a duration to time t. Since duration can be…
Understanding Duration in time package in Go (Golang)
duration is the time that has elapsed between two instants of time. It is represented as int64nanosecond count. So duration is nothing in Go but just a number representing time in nanoseconds…
Convert time between different timezones in Go (Golang)
Every time.Time object has an associated location value. When you change the location of any time.Time object to any other location, then that instant of time is not changed. Only the location…
Get current time and date of different timezones in Go (Golang)
time package has a LoadLocation(name string) function which can be used to load a location of anywhere. Once you have the location, then In function can be used to change the location…
Time Difference between two time value in Go (Golang)
Overview In Go time is represented by the time.Time struct. It struct has a method Sub which can be used to get the difference between two different time values. The Sub function…
Parse Time in Golang
Overview Parse function of time package in golang can be used to parse the string representation of time into time.Time object Package link – https://golang.org/pkg/time/#Parse If you have worked with time/date formatting/parsing…
Time Conversion in Go (Golang)
Overview Time can be represented in GO in below 5 formats: time.Time object Unix Time (Also known as Epoch Time) – It is the number of seconds elapsed since 00:00:00 UTC on 1…