startTime := time.Unix(logUserDetail[k].LogTime, 0)
startTimeOfLog := startTime.String()[11:16]
I have time in timestamp format and it is in UTC time zone. I want to convert this time to the local timezone according to our location.
logUserDetail[k].LogTime is in timestamp(1499335473)
You can use (t Time) In()
(Golang documentation) to convert startTime
to use your local timezone.
Please check the Local function for time structs: https://golang.org/pkg/time/#Time.Local
package main
import (
"fmt"
"time"
)
func main() {
startTime := time.Now()
fmt.Println(startTime.Local())
}