Created
July 11, 2019 20:15
-
-
Save xXPhenomXx/03fcee24a320d02f33801ce245b0c036 to your computer and use it in GitHub Desktop.
Convert UTC time to CST in Golang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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