Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parsed ¶
type Parsed struct {
// contains filtered or unexported fields
}
Parsed is a parsed cron string. It can be used to find the next instance of a cron task.
func ParseUTC ¶
ParseUTC parses a cron string in UTC timezone.
Example ¶
package main import ( "fmt" "time" "github.com/influxdata/cron" ) func main() { p, err := cron.ParseUTC("10 * * * * *") if err != nil { fmt.Println(err) } ts, err := p.Next(time.Date(1999, 12, 31, 23, 59, 59, 0, time.UTC)) if err != nil { fmt.Println(err) } fmt.Println(ts) }
Output: 2000-01-01 00:00:10 +0000 UTC
func (*Parsed) Count ¶
Count gives us a count of the number of calls Parsed.Next would take to iterate though the time interval [from, to). We try to be O(1) where possible. However for periods longer than a month that don't use @every, it is worst case O(m) where m is the number of months in the interval.
Click to show internal directories.
Click to hide internal directories.