Code Monkey home page Code Monkey logo

gocron's Introduction

gocron

Go Reference

The gocron package provides primitives to parse a Cron expression and iterate over the activation times.

Install

go get github.com/Gilthoniel/gocron

Support

This package implements the specification found in Wikipedia and includes some advanced usages from the Quartz scheduler.

Field name Allowed values Allowed special characters
Seconds 0-59 , - * /
Minutes 0-59 , - * /
Hours 0-59 , - * /
Day of month 1-31 , - * ? / L
Month 1-12 , - * /
Day of week 0-6 or SUN-SAT , - * ? / L #
Years 1-9999 , - * /

Special characters

  • * can be used to select all values within a field (e.g. every second, every minute, ...)
  • ? can be used for no specific value in the day field or the week day field.
  • - can be used to specify an inclusive range (e.g. 1-3 means values 1, 2, and 3).
  • , can be used to list values (e.g. 1,2,3 means values 1, 2 and 3).
  • / can be used to specify an interval (e.g. 1/5 means values 1, 6, 11, 16, etc...).
  • L when used in the month field specifies the last day of the month and Saturday when used in the week day field. Using a digit before the character in the week day field specifies the nth last week day of the month (e.g. 1L for the last Monday of the month). An offset can also be used for the month field (e.g. L-2 for the second last day of the month).
  • # can be used to specify the nth week day of the month (e.g. 6#3 for the third (3) Saturday (6) of the month).

gocron's People

Contributors

gilthoniel avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.