Skip to content

Instantly share code, notes, and snippets.

@k-nishijima
Last active July 6, 2017 07:23
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 k-nishijima/e8171f50941393480176a76343f6d90c to your computer and use it in GitHub Desktop.
Save k-nishijima/e8171f50941393480176a76343f6d90c to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"os"
"strconv"
"time"
)
func main() {
i := os.Args[1]
if len(i) == 19 {
i = i[0:10]
}
num, _ := strconv.ParseInt(i, 10, 64)
fmt.Println(time.Unix(num, 0))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment