Skip to content

Instantly share code, notes, and snippets.

@redbarron23
Created October 17, 2017 03:07
Show Gist options
  • Save redbarron23/5512418cab79c7922a48f80ca2645ff5 to your computer and use it in GitHub Desktop.
Save redbarron23/5512418cab79c7922a48f80ca2645ff5 to your computer and use it in GitHub Desktop.
gmt time in go
package main
import (
"fmt"
"time"
)
// borrowed from here
// https://stackoverflow.com/questions/37608823/get-the-current-time-with-gmt2-in-golang
func main() {
t := time.Now().UTC()
fmt.Printf("%02d:%02d:%02d-00:00\n",
t.Hour(), t.Minute(), t.Second())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment