Skip to content

Commit

Permalink
add parse next time example
Browse files Browse the repository at this point in the history
  • Loading branch information
rfyiamcool committed Jan 3, 2019
1 parent 7cb823a commit bf3bf0a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions example/parse_next_time.go
@@ -0,0 +1,20 @@
package main

import (
"fmt"
"time"

"github.com/rfyiamcool/cronlib"
)

func main() {
t, err := cronlib.Parse("0 0 0 */1 * *")
if err != nil {
panic(err.Error())
}

fmt.Println(" now: ", time.Now())
next := t.Next(time.Now())
fmt.Println("next: ", next)
}

0 comments on commit bf3bf0a

Please sign in to comment.