{
  "id": 8649765,
  "title": "Stop hand-writing cron: build and parse it in Java",
  "url": "https://urgent.news/2026/09/20/stop-hand-writing-cron-build-and-parse-it-in-java",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-20T08:55:55.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/paganini2008/stop-hand-writing-cron-build-and-parse-it-in-java-3gkj"
  },
  "original_language": "en",
  "account": "Stop hand-writing cron expressions: build and parse them in Java. Building and parsing cron expressions in Java is a more reliable way to handle scheduling tasks. The CronBuilder class allows you to chain schedule specifications and generate the corresponding cron string. For example, every 5 seconds can be represented as */5 * * * * ? 0 30 9 * * ? every day at 09:30 0 10 15 ? * MON-FRI every weekday at 15:10. More complex schedules, such as the last Friday of the month at 18:00 or the 3rd Saturday of the month every 2 hours, can also be expressed using the CronBuilder. Parsing cron strings is just as easy using the CRON.parse() method, which normalizes the string and converts it into an object representing the schedule. This eliminates the need to remember the various quirks of cron syntax, such as the meaning of L, #, and W, or whether 1 represents Sunday or Monday. The parsed schedule can then be converted into the appropriate format for different scheduling systems, such as Quartz, Spring, AWS EventBridge, or Unix. The CronBuilder library makes it simple to build and parse cron expressions, ensuring accurate scheduling without the guesswork associated with manual typing.",
  "summary": "Stop hand-writing cron: build and parse it in Java Quick, what does this fire? 0 0 18 ? * FRIL Last Friday of every month, 6 PM. You probably got the 6 PM part. The FRIL is the kind of thing you paste into a comment and hope nobody asks about later. I got tired of that guessing game, so I've been using cronsmith , a small Java library that lets you build a cron expression by describing it, parse…",
  "key_points": [
    "Build and parse cron expressions in Java using CronBuilder class",
    "Simplifies scheduling tasks by eliminating manual cron typing errors",
    "Supports complex schedules like last Friday or 3rd Saturday of month"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}