Skip to content

Instantly share code, notes, and snippets.

@khajer
Created September 28, 2018 02:58
Show Gist options
  • Select an option

  • Save khajer/96e177c621314b1554e3be27a25c6efc to your computer and use it in GitHub Desktop.

Select an option

Save khajer/96e177c621314b1554e3be27a25c6efc to your computer and use it in GitHub Desktop.
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