Explain a Linux, Spring or Quartz cron expression, or build one from the fields, and list the next 10 runs in this computer’s local time. Build a crontab
Pick Linux Crontab (5 fields), Spring @Scheduled (6 fields, seconds first) or Quartz (6 fields, or 7 with a year). The page explains each field and lists the next 10 runs on this computer’s clock. It does not install the job. To build one from a time of day or from @daily, use the crontab generator. Timestamps are Unix timestamp.
*/15 9-17 * * 1-5, Spring 0 */15 9-17 * * MON-FRI, Quartz 0 */15 9-17 ? * MON-FRI.? into * on Linux, and rewrites weekday numbers as SUN–SAT so the same days stay selected.Linux is minute, hour, day of month, month, day of week. Sunday is 0, 7 or SUN. Monday is 1. There is no ?, L, W or #. If both the day of month and the day of week are restricted, either match is enough, and the result says so.
Spring adds seconds in front. Sunday uses the same numbers as Linux. ? means that field is ignored. L is the last day of the month. 15W is the weekday nearest the 15th and stays inside the month. LW is the last weekday. MON#1 is the first Monday. 6L is the last Saturday, because 6 is Saturday.
Quartz uses the same six fields, plus an optional year such as 2024-2030. Sunday is 1 or SUN. Monday is 2. Saturday is 7. 6L is the last Friday. One of the day or the weekday should be ?, as in 0 0 2 * * ? for 02:00 every day. If both are specific, the result still lists a run when either field matches, and it warns. Names SUN–SAT and JAN–DEC work in any letter case and mean the same day or month in all three formats.
A hyphen is a range, a comma is a list, and a slash is a step. */15 steps from the start of the field. 5/15 starts at 5 and steps to the end, so minutes are 5, 20, 35 and 50. Times are local, not UTC. With a seconds field the list steps by seconds; otherwise it steps by minutes.
0 2 * * * before it is installed.0 0 2 * * * for 02:00 every day.0 15 10 ? * 6L (last Friday at 10:15) or 0 0 23 L * ? (23:00 on the last day of the month).Linux has no seconds field, so 02:00 is 0 2 * * *. Spring and Quartz put seconds first, so the same time is 0 0 2 * * * or, on Quartz, 0 0 2 * * ?.
It means that field is not set. Quartz wants it on either the day of month or the day of week. 0 0 2 * * ? is 02:00 every day.
On Linux and Spring, 1 is Monday and Sunday is 0 or 7. On Quartz, 1 is Sunday and 2 is Monday. SUN is Sunday in all three.
Next 10 runs uses this computer’s local time zone.