mirror of
https://github.com/rfyiamcool/cronlib.git
synced 2025-10-05 11:16:48 +08:00
add dynamic register
This commit is contained in:
20
example/parse_time/parse_next_time.go
Normal file
20
example/parse_time/parse_next_time.go
Normal file
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user