cron

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package cron parses five-field cron expressions and computes their schedule, always in UTC.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schedule

type Schedule struct {
	// contains filtered or unexported fields
}

Schedule is a parsed cron expression.

func Parse

func Parse(expr string) (*Schedule, error)

Parse parses "minute hour day-of-month month day-of-week" (each field: *, a number, a range a-b, a list, and /step; month and weekday names work) or one of @hourly, @daily, @weekly, @monthly, @yearly. As in classic cron, when both day fields are restricted a time matches if either does.

func (*Schedule) Prev

func (s *Schedule) Prev(t time.Time) (time.Time, bool)

Prev returns the latest scheduled time at or before t (UTC, minute resolution), or false if none exists within about eight years back.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL