NCRONTAB - last day of the month (Azure Functions)
At 04:30, every day.
Next runs · UTC
- —
- —
- —
- —
- —
Calendar
September 2026 · UTC
0 runs
About this tool
L modifier. To run a function on the last day of every month, schedule daily and check the date in your code, or register three separate triggers covering each month length.seconds minute hour day-of-month month day-of-week. No year field, no L, no W, no ?. It's strict standard cron with seconds added at the front.Azure Function - daily trigger + runtime check
using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
public class MonthEndFunction
{
[FunctionName("MonthEnd")]
public void Run(
[TimerTrigger("0 0 0 * * *")] TimerInfo myTimer,
ILogger log)
{
var today = DateTime.UtcNow.Date;
if (today.AddDays(1).Day != 1)
{
log.LogInformation("Not the last day of {Month} - skipping.", today.ToString("MMMM"));
return;
}
log.LogInformation("Running month-end work for {Date}", today);
// ... your last-day-of-month work here
}
}Multi-trigger approach
If you prefer to encode the “last day” logic in the schedule itself, register three timer triggers (one per month-length group):
[FunctionName("MonthEnd30")]
public void Run30([TimerTrigger("0 0 0 30 4,6,9,11 *")] TimerInfo t, ILogger log) => RunMonthEnd(log);
[FunctionName("MonthEnd31")]
public void Run31([TimerTrigger("0 0 0 31 1,3,5,7,8,10,12 *")] TimerInfo t, ILogger log) => RunMonthEnd(log);
[FunctionName("MonthEnd28")]
public void Run28([TimerTrigger("0 0 0 28 2 *")] TimerInfo t, ILogger log) {
if (DateTime.UtcNow.AddDays(1).Day == 1) RunMonthEnd(log);
}
[FunctionName("MonthEnd29")]
public void Run29([TimerTrigger("0 0 0 29 2 *")] TimerInfo t, ILogger log) {
if (DateTime.UtcNow.AddDays(1).Day == 1) RunMonthEnd(log);
}Three or four functions for one logical job is a lot of boilerplate. The daily-with-runtime-check approach is usually cleaner.
NCRONTAB syntax cheat-sheet
- 6 fields - seconds, minute, hour, day-of-month, month, day-of-week.
- Always UTC in the consumption plan; the premium plan supports the
WEBSITE_TIME_ZONEsetting. - No `L`, `W`, `?`, `#` - last-day, weekday, no-specific-value and Nth-weekday modifiers are unsupported.
- Step / list / range - supported in every field.
- Aliases -
JAN-DEC,SUN-SATaccepted.
NCRONTAB pitfalls
- Cold starts - Azure Functions on the consumption plan can take a few seconds to start. For a last-day-of-month job that needs to fire at exactly 00:00, use a Premium plan or the dedicated tier.
- Concurrent runs - by default, the timer trigger doesn't prevent overlap if the previous run is still going. Use a singleton lock if your work is not safe to run twice.
- Local development - `func host start` respects the cron schedule in real time. To test the runtime check, fake
DateTime.UtcNowvia a clock abstraction.
Examples
- 0 18 * * *Every day at 18:00
- 0 */5 * * *Every 5 hours
- 0 18 * * 1-5Weekdays at 18:00
- 0 0 1 * *Once a month, on the 1st at midnight
Cheatsheet
Full cheatsheet| Field | Req. | Range | Wildcards |
|---|---|---|---|
| minute | yes | 0-59 | , - * / |
| hour | yes | 0-23 | , - * / |
| day of month | yes | 1-31 | , - * / |
| month | yes | 1-12 or JAN-DEC | , - * / |
| day of week | yes | 0-6 or names; some dialects use 0-7 or 1-7 — see Dialects | , - * / |
Frequently asked questions
Syntax
Does NCRONTAB support the L modifier?
No. NCrontab does not support L; schedule daily and continue only when now.AddDays(1).Day == 1. A multi-trigger February schedule using days 28 and 29 still needs that guard because both dates occur in leap years.
How many fields does NCrontab parse by default?
NCrontab parses five fields by default: minute, hour, day of month, month, and day of week. Seconds are opt-in rather than automatic.
How do I enable six-field NCrontab expressions?
Parse with CrontabSchedule.ParseOptions and set IncludingSeconds = true. The first field then represents seconds, so 0 0 0 * * * means daily at midnight. Expression: 0 0 0 * * *
Which extended operators are unavailable in NCrontab?
NCrontab does not support L, W, #, ?, or Jenkins H. Use application logic for last-day, nearest-weekday, nth-weekday, and hashed schedules.
Days and months
Why is the daily-with-runtime-check pattern recommended?
It keeps the cron string standard and the date logic in C# / TypeScript where it's easy to test, easy to log, and reads naturally. The multi-cron approach (three triggers) requires three Function entry points or routing inside one - more moving parts for the same outcome.
What C# check identifies the last day of a month?
Check whether now.Date.AddDays(1).Day == 1. Run that predicate from a daily trigger and continue only when tomorrow begins a new month.
Does the NCrontab runtime check handle leap years?
Yes. Adding one day handles the Gregorian calendar automatically, so the predicate matches February 28 or 29 as appropriate.
Timezones and DST
Which timezone does NCrontab use for month-end?
The host application supplies the dates and timezone; NCrontab itself does not choose one. Evaluate the trigger and last-day predicate in the same zone.
Can DST affect an NCrontab month-end trigger?
Yes, if the host evaluates the schedule in a DST-observing zone. UTC avoids missing or repeated local wall-clock times around transitions.
Platforms
What's the difference between NCRONTAB and AWS / Quartz cron?
NCRONTAB is 6 fields (seconds, minute, hour, day-of-month, month, day-of-week) with the seconds field at the front. AWS EventBridge is also 6 fields but with year at the END (no seconds). Quartz is 6 or 7 fields with seconds at the front and optional year at the end. NCRONTAB does not support L, W, ? or #.
How do I configure NCRONTAB for an Azure Function?
In function.json or via the [TimerTrigger("...")] attribute. Example: [TimerTrigger("0 0 0 * * *")] runs daily at midnight UTC. For last-day-of-month, schedule daily and check DateTime.UtcNow.AddDays(1).Day == 1 inside the function. Expression: 0 0 0 * * *
Debugging
How can I validate an NCRONTAB expression?
Validate with CrontabSchedule.TryParse, using IncludingSeconds when needed. CronTool does not emulate NCrontab: it accepts operators NCrontab rejects and applies Vixie OR semantics where NCrontab uses AND.
How should I test NCrontab last-day logic?
Inject a clock and test the final dates of February in leap and ordinary years plus 30- and 31-day months. Keep parsing tests separate from calendar-predicate tests.
Does NCrontab prevent overlapping month-end runs?
No. NCrontab calculates occurrences; the hosting scheduler controls execution. Use the host's singleton mechanism, a distributed lock, and a month-based idempotency key.
Crontap
Can Crontap run the NCrontab last-day workaround?
Yes. You can call an HTTP-backed .NET job daily from Crontap and keep the AddDays(1).Day == 1 check in application code.
Write the cron here. Run it on Crontap.
Point Crontap at any URL. Pick any cron. Done.
WordPress, Shopify, Railway, Cloud Run, Vercel, HubSpot, Ghost, your own box. If it answers HTTP, Crontap can drive it on a clock you can read, in the timezone that actually matters, and page you when something breaks.
1.9k+ teams · Free forever tier · No credit card