Skip to main content
Code and think

Cron expression

Cron expressions are very popular way to define schedules. Here you will find basics of cron expressions.

Expression parts

Value 0 1 * * *
Scale minute hour day month weekday
Sign Description Example
minute on which minute shall it be triggered 0 - 59
hour on which hour shall it be triggered 0 - 23
day on which day shall it be triggered 1 - 31
month on which month shall it be triggered 1 - 12 / JAN-DEC
weekday on which day of week shall it be triggered 0 - 6 / SUN-SAT

Weekday names

Number Day of the week
0 SUN
1 MON
2 TUE
3 WED
4 THU
5 FRI
6 SAT

Special signs

Sign Description Example
* any value *
, value list separator 0,1,2,3,4,5,6
- range of values 0-6
/ step values 1/2

Examples

Expression Description
0 0 * * * Every day at 00:00
0 1 * * * Every day at 01:00
30 1 * * * Every day at 01:30
30 20 * * * Every day at 20:30
0 20 * * 0 Every Sunday at 20:00
0 20 * * 0/2 Every second Sunday at 20:00
0 0/2 * * * Every second hour

Reference