Skip to content

Instantly share code, notes, and snippets.

@2matzzz
Created November 15, 2015 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2matzzz/327eacfbcb2b8b0a30a7 to your computer and use it in GitHub Desktop.
Save 2matzzz/327eacfbcb2b8b0a30a7 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
)
func main() {
currentTimeUnix := time.Now().Unix()
currentTimeRFC3339 := time.Now().Format("2006-01-02T15:04:05Z07:00")
aHourAfter := time.Now().Add(1 * time.Hour).Format("2006-01-02T15:04:05Z07:00")
fmt.Printf("Unix:%d\n", currentTimeUnix)
fmt.Printf("RFC3339:%s\n", currentTimeRFC3339)
fmt.Printf("aHourAfter:%s\n", aHourAfter)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment