Skip to content

Instantly share code, notes, and snippets.

@xXPhenomXx
Created July 11, 2019 20:15
Show Gist options
  • Select an option

  • Save xXPhenomXx/19dda26b88ed262966f7ff1e329db09b to your computer and use it in GitHub Desktop.

Select an option

Save xXPhenomXx/19dda26b88ed262966f7ff1e329db09b to your computer and use it in GitHub Desktop.
Convert UTC time to CST in Golang
// Handle UTC to CST conversion
loc, _ := time.LoadLocation("America/Chicago")
if err != nil {
fmt.Println(err)
}
dateAdded = dateAdded.In(loc)
p.DateAdded = dateAdded.Format("01/02/2006 03:04:05 PM")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment