Created
September 28, 2018 02:58
-
-
Save khajer/96e177c621314b1554e3be27a25c6efc to your computer and use it in GitHub Desktop.
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
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| "math/rand" | |
| ) | |
| func main() { | |
| fmt.Println("generate time in/out") | |
| for i:=0; i <20 ; i++{ | |
| tStart, _ := time.Parse(time.RFC3339, "2006-01-02T09:15:15+07:00") | |
| tStart = tStart.Add(time.Minute * time.Duration(rand.Intn(20))) | |
| tEnd := tStart.Add(time.Hour * 9).Add(time.Minute * time.Duration(rand.Intn(20))) | |
| fmt.Println(tStart.Format("03:04"), tEnd.Format("18:04")) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment