Cron Fundamentalsintermediate

What is L Modifier?

An extended cron character meaning "last" — used for last day of month or last weekday.

Definition

The L modifier is a non-standard extension supported by many cron implementations (including Quartz, Spring, and CronJobPro). In the day-of-month field, L means "the last day of the month" (28, 29, 30, or 31 depending on the month). In the day-of-week field, 5L means "the last Friday of the month." It solves the problem of months having different lengths.

💡

Simple Analogy

Like saying "the last page of this book" without knowing how many pages it has — L automatically adjusts to the correct final value.

Why It Matters

Many business processes need to run on the last day of the month (month-end closing, final billing cycle, end-of-month reports). Without L, you would need to hard-code 28, 29, 30, or 31 and risk skipping months or running on the wrong day.

How to Verify

Verify your cron implementation supports L (standard POSIX cron does not). CronJobPro and most SaaS schedulers support it. Test by checking if a job scheduled with L in January shows January 31st, February 28th/29th, and April 30th in the next runs.

⚠️

Common Mistakes

Using L in standard Linux crontab — it is not supported. Combining L with other values in the same field (L,15 or L-3 may not work in all implementations). Assuming LW means "last weekday" — L and W combined as LW means "the nearest weekday to the last day of the month."

Best Practices

Use L for end-of-month jobs where the exact date varies. For "last business day of month," combine L with W: LW. If your cron implementation does not support L, schedule on the 28th as a safe fallback that works every month.

Cron Expression Generator

Build your cron expression

Try it free →

Frequently Asked Questions

What is L Modifier?

The L modifier is a non-standard extension supported by many cron implementations (including Quartz, Spring, and CronJobPro). In the day-of-month field, L means "the last day of the month" (28, 29, 30, or 31 depending on the month). In the day-of-week field, 5L means "the last Friday of the month." It solves the problem of months having different lengths.

Why does L Modifier matter for cron jobs?

Many business processes need to run on the last day of the month (month-end closing, final billing cycle, end-of-month reports). Without L, you would need to hard-code 28, 29, 30, or 31 and risk skipping months or running on the wrong day.

What are best practices for L Modifier?

Use L for end-of-month jobs where the exact date varies. For "last business day of month," combine L with W: LW. If your cron implementation does not support L, schedule on the 28th as a safe fallback that works every month.

Related Terms