Test an APScheduler cron trigger.
Paste the string you pass to CronTrigger.from_crontab(). The tester uses a port of APScheduler 3.11’s field parser, checked against APScheduler itself, and flags the weekday numbering that makes copied crontab lines run on the wrong days.
How APScheduler cron reads a schedule.
| Fields | 5: minute, hour, day, month, day_of_week, split on spaces. |
| Day of week | 0-6 with 0 = Monday (APScheduler 3.x), or names mon-sun. 7 is rejected. |
| Day + day of week | Every field must match (AND). |
| Extras | last in the day field (last day of the month); 5/10 means 5, 15, 25… |
| Time zone | timezone argument, otherwise the scheduler’s time zone. |
| Not supported | L, W, #, ?, @daily-style shortcuts. 1st mon and last fri need the keyword form, because from_crontab splits on spaces. |
The parser is a port of APScheduler 3.11’s cron fields. It was compared with APScheduler itself (from_crontab() and get_next_fire_time()) on 8,000 cases (0 differences). Last checked 18 November 2026.
The weekday trap: 1-5 is Tuesday to Saturday
APScheduler 3.x numbers weekdays from 0 = Monday, Python-style. Its own docstring for from_crontab() calls this “a historical mistake”: crontab treats 0 as Sunday, and the mismatch is fixed only in the 4.x series. So CronTrigger.from_crontab('0 9 * * 1-5') runs 09:00 Tuesday to Saturday. Running APScheduler 3.11 confirms it. Use names (mon-fri) and the problem disappears; the tester rewrites numeric weekdays for you.
When to use the keyword form
CronTrigger(day='last fri', hour=18) (the last Friday of the month) and day='1st mon' cannot be written through from_crontab(), because the string is split on spaces. Use keyword arguments for those, and for seconds (second='*/10'), which a five-field crontab line cannot express.
APScheduler 4
APScheduler 4.0 is still a pre-release (4.0.0a6 on PyPI at the last check) and changes the API. The tester follows the 3.x series, which is what pip install apscheduler installs.
Sources: APScheduler 3.x: cron trigger · APScheduler issue 286 (weekday numbering) · APScheduler on PyPI
Related: Daylight saving time checker · Crontab file checker · All platform tools
APScheduler cron FAQs.
Yes, in APScheduler 3.x day_of_week runs 0-6 with Monday = 0. Crontab uses Sunday = 0, so numeric weekdays copied from a crontab run one day later. Names such as mon-fri avoid the problem.
Because APScheduler 3.x reads 1-5 as Tuesday to Saturday (0 = Monday). Write 0 9 * * mon-fri, or 0-4 in APScheduler numbering.
Use last in the day field: CronTrigger.from_crontab('0 0 last * *') or CronTrigger(day='last', hour=0, minute=0).
Yes. Every field of a CronTrigger must match, so 0 0 13 * fri runs only on Friday the 13th.
No, it takes exactly five fields. Use CronTrigger(second=..., minute=..., ...) for second-level schedules.