CronExpression

A cron expression of six fields, with the syntax of Spring's CronExpression, evaluated without a dependency: second minute hour day-of-month month day-of-week.

  • Each field is * (or ?), a value, a range a-b, a step x/n (from x, a value, a range or *, every n), or a list of them separated by commas. Months may be named JAN–DEC, days of the week SUN–SAT, in any case; a day of the week is 0–7, both 0 and 7 Sunday.

  • Day of month: L is the last day of the month, L-n the n-th day before it, LW its last weekday, nW the weekday nearest to day n within the month.

  • Day of week: dL is the last day d of the month (5L, FRIL), d#n its n-th day d (MON#1).

  • A day must match both day fields, as Spring reads them.

  • The macros @yearly (@annually), @monthly, @weekly, @daily (@midnight) and @hourly.

next reads the fields as local times of a time zone: a local time that a daylight saving gap skips runs at the instant it would have been, later by the length of the gap (02:30 in a spring-forward gap runs at 03:30), unless an earlier time already ran at that instant; a local time that an overlap repeats runs once, at its earlier offset.

Types

Link copied to clipboard

Properties

Link copied to clipboard

The expression as given.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun next(after: Instant, zone: ZoneId): Instant?

The first time after after that this expression names in zone, or null when it names none within MAX_YEARS years (such as 0 0 0 30 2 *).

Link copied to clipboard
open override fun toString(): String