Skip to content

Date Repeater

The date repeater task breaks a given range into smaller chunks, and loops through them. The chunk size is configurable, so for example, it can be set to loop through a date range on a week by week basis.

In each iteration of the loop, the date repeater will run it's set of child tasks. The current chunk of time is accessible via context variables.

Settings

Date Increment

Required
This group of settings controls how the date range is divided up into smaller chunks to loop through.

For example, if 'Unit' is set to Days and 'Value' is set to 7, the task will divide the date range into weeks, and loop through each one.

Unit

Required
The unit of time the date will increment by in each iteration of the loop. The following options are available:

  • Hours
  • Days
  • Months
  • Years

Value

Required
How many units of time the date will increment by in each iteration of the loop.

Date Range

Required
This group of settings controls the range of dates the task will loop through.

For example, if 'Start Date' is set to 01/01/2026 00:00 and 'End Date' is set to 01/01/2027 00:00, the task will loop through the whole of 2026 in the increment specified.

End Date

Required
The date to stop the loop on.

Note

When running the task in 'Rolling' mode, this setting will always be updated to the current date/time. Any value entered here will essentially be ignored.

Mode

Required
Specify the date range mode. The following options are available:

  • Fixed - The task will treat the start and end dates as fixed points in time. So it will loop through the same date range every time it runs.
  • Rolling - The task will automatically adjust the start and end dates each time it runs. It does so in a way that ensures it doesn't loop over the same dates more than once, and doesn't go beyond the current date.

Note

When using 'Fixed' mode, the final chunk of time the task loops through may be shorter than the rest, as it will contain any remaining time that is left over.

Note

When using 'Rolling' mode, the task will only iterate through whole chunks of time, as defined by the increment settings. Therefore the task won't enter the loop until at least one whole chuck of time has elapsed since the start date.

Start Date

Required
The date to start the loop on.

Note

When running the task in 'Rolling' mode, this setting will be updated to the end point of the last chunk of time.

Zynk Settings

See Common Task Settings

Context Variables

The following variables are available to the child tasks. To use these variables, reference them in templates asĀ @Context.Current["Start"], or within the task settings using the Razor option.

  • Start - The starting point of the current chunk of time. It is formatted based on the locale settings in Windows, so the formatting can vary from machine to machine.
  • StartIso - The starting point of the current chunk of time, in ISO 8601 format. For example 2026-01-31T23:59:59
  • StartSql - The starting point of the current chunk of time, formatted for use in SQL queries. For example 2026-01-31 23:59:59
  • End - The end point of the current chunk of time. It is formatted based on the locale settings in Windows, so the formatting can vary from machine to machine.
  • EndIso - The end point of the current chunk of time, in ISO 8601 format. For example 2026-01-31T23:59:59
  • EndSql - The end point of the current chunk of time, formatted for use in SQL queries. For example 2026-01-31 23:59:59

In case you need to manipulate the date values in any way, the raw DateTime objects can be accessed as follows:

  • @Context.Object.Item1 - The raw DateTime instance for the start point.
  • @Context.Object.Item2 - The raw DateTime instance for the end point.

Note

The values of the start and end points are both inclusive. Therefore the start point will always be equal to the end point from the previous iteration.

Example

If a fixed date range is specified from 01/01/2026 09:10 to 01/01/2026 11:30, and the increment is hourly, there will be three iterations every time the task runs. The following values will be seen in the context variables:

Iteration Start End
1 01/01/2026 09:10:00 01/01/2026 10:10:00
2 01/01/2026 10:10:00 01/01/2026 11:10:00
3 01/01/2026 11:10:00 01/01/2026 11:30:00

If a rolling date range is specified from 01/01/2026 09:10, the increment is hourly, and the task is ran at 01/01/2026 12:00, there will be two iterations. The following values will be seen in the context variables:

Iteration Start End
1 01/01/2026 09:10:00 01/01/2026 10:10:00
2 01/01/2026 10:10:00 01/01/2026 11:10:00

The task won't perform another iteration until after 01/01/2026 12:10.