Cron to human readable string

Well yes I did understand your question. But I should have explained my answer a little better.

No I don’t know any tool that will help you get a cron expression in “human” readable form. But by getting access to the CronExpression you can create you own.

Try calling

cronTrigger.getExpressionSummary() 

on the cron expression:

"0/2 * * 4 * ?"

it returns the following String:

seconds: 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58
minutes: *
hours: *
daysOfMonth: 4
months: *
daysOfWeek: ?
lastdayOfWeek: false
nearestWeekday: false
NthDayOfWeek: 0
lastdayOfMonth: false
calendardayOfWeek: false
calendardayOfMonth: false
years: *

By having access to the CronExpression object, you can create your own "human" explenation.


cron-utils may be useful for this task, since provides human readable descriptions and does not require a fully fledged scheduler to provide them. Is well documented and supports multiple cron formats.

Below a code snippet from the docs:

//create a descriptor for a specific Locale
CronDescriptor descriptor = CronDescriptor.instance(Locale.UK);

//parse some expression and ask descriptor for description
String description = descriptor.describe(parser.parse("*/45 * * * * *"));
//description will be: "every 45 seconds"

A Java library that converts cron expressions into human readable strings: https://github.com/RedHogs/cron-parser