import ( "fmt" "os" "strconv" "time" ) func main() { timeArray := []string{} idx := 0 for _ ,arg := range os.Args{ if idx ==0 { idx = 1 continue } timeArray = append(timeArray,arg) } transTime := []string{} for _ , curTime := range timeArray{ i, err := strconv.ParseInt(curTime, 10, 64) if err != nil { fmt.Println("ParseInt Failed", err.Error()) } tm := time.Unix(i,0) fmt.Println(tm.Format("2006-01-02 03:04:05 PM")) transTime = append(transTime, tm.Format("2006-01-02 03:04:05 PM")) } time.Sleep(time.Second*1000) }