We have added several new macros in the upcoming 3.21 version of ReportMagic, that can help you to get the human readable text for a CRON string, as well as the next and last date / times that it will / did fire.
This is useful because ReportMagic Schedules and DataMagic Syncs can be set to fire automatically by specifying a CRON, and in your reports, when fetching details about Schedules, for example, the macros can be used to parse the CRON into something more meaningful.
Both macros are in the “Time” category.
The first macro is called [CronHumanReadable:] and can be used as follows (see the help for even more details):
Here’s the help page:
Examples:
[CronHumanReadable: value="0 0 * * *", storeAs=A]
which outputs:
At 00:00, every day
[CronHumanReadable: value="0 0 * * 1,2,3,4,5", storeAs=F]
which outputs:
At 00:00, only on Monday, Tuesday, Wednesday, Thursday, and Friday
The second macro is called [CronRunDate:]
Here’s the help page:
To find the next date that a CRON will trigger on, use this example:
[CronRunDate: value="0 0 0 1 1 ?", cronScheduleType=Next, storeAs=NextDateTime]
which if ran today would output:
2026-01-01 00:00:00
To find the last date that the same CRON ran on, use this:
[CronRunDate: value="0 0 0 * 5 ?", cronScheduleType=Last, storeAs=LastDateTime]
which outputs:
2025-01-01 00:00:00
If the CRONs don’t have a next / last, or are specified incorrectly, a macro error will normally appear in the document (shown as red on the progress page), with the reason why.