All Products
Search
Document Center

DataWorks:Supported formats for scheduling parameters

Last Updated:Oct 23, 2025

Scheduling parameters are a core DataWorks feature that dynamically replaces time-based values in your code during automated task runs. This eliminates the need to hardcode dates in recurring tasks, allowing your workflows to automatically adapt to different business dates and execution times. This topic describes the supported formats for parameter values of scheduling parameters and their usage.

Important

Before reading this topic, make sure you understand how to configure scheduling parameters. For more information, see Configure and use scheduling parameters.

Core concepts: Time baselines

All dynamic time parameters in DataWorks are based on the following two core time baselines.

Concept

Definition

Parameter value

Custom format

Time precision

Business date

The date of the data being processed, usually the day before the task's scheduled run date.

In T+1 batch processing scenarios (where today's task processes yesterday's data), this represents the date when the business data occurred. For example, if you're calculating yesterday's sales revenue today, yesterday is the date when the transactions occurred, which is the business date.

${yyyymmdd}

${...}

Year, month, day

Scheduling time

The scheduling time configured in Scheduling for the task. When an instance is created, this value is set and remains fixed. It's accurate to the second and independent of the task's actual run time.

This represents the expected execution time of the task and may not be identical to the actual start time. The actual start time is affected by multiple factors.

$[yyyymmddhh24miss]

$[...]

Year, month, day, hour, minute, second

Concept summary:

  • Business date ≈ Yesterday (the date of the data)

  • Scheduling time ≈ Today (when the task runs)

A typical T+1 task starts in the early morning of today (scheduling time) to process data from yesterday (business date).

Principles

You can configure parameters and assign values in Scheduling > Scheduling Parameters, and preview replacement values for future task instances using the parameter preview feature. For more information about the parameter configuration process, see Configure and use scheduling parameters.

  • You can use built-in system parameters $bizdate and $cyctime to directly assign values for business date and scheduling time. In terms of values, $bizdate is equivalent to ${yyyymmdd}, and $cyctime is equivalent to $[yyyymmddhh24miss].

    image

    image

    The figures show the parameter definitions and preview results when the business date is October 16, 2025 for $bizdate vs. ${yyyymmdd} and $cyctime vs. $[yyyymmddhh24miss].
  • If the baseline time parameter return values don't meet your requirements, you can create custom time parameters using ${...} and $[...]. Custom time parameters are transformations based on the two time baselines and support the following methods:

Important

When assigning values to scheduling parameters using custom methods, note the difference between the two bracket formats {...} and [...]. The two formats use different baseline values and produce completely different parameter values. Mixing them up can cause data errors in production.

Value assignment types

Scheduling parameters support several assignment types, including:

  • Built-in system parameters: Such as $bizdate, $bizmonth, and $jobid, which can be used to obtain business date, business month, workflow ID, and more. They are not limited to time-based values. For more information, see Built-in system parameters.

  • Custom time parameters: Such as ${...} and $[...], which can be transformed based on the two time baseline values. For details, see Custom time parameters.

  • Constants: Such as '123' or 'abc'.

Custom time parameters

DataWorks supports using ${...} and $[...] to retrieve business date and scheduling time. It also supports transformations to adjust the time. The following examples assume the node is configured with daily scheduling and a scheduling time of 02:30:45. Assuming the business date is October 31, 2025, here are the baseline times:

  • Business date: ${yyyymmdd}, which is 20251031 in this example.

  • Scheduling time: $[yyyymmddhh24miss], which is 20251101023045 in this example.

    Important

    The scheduling time is a preset value that is fixed when a task instance is generated. If an instance is delayed due to factors like resource constraints or the status of upstream nodes, its scheduling time does not change; it is independent of the actual run time.

Core differences between ${...} and $[...]

Understanding the core differences between the ${...} and $[...] formats is crucial, as they have fundamental differences in their time baselines and calculation capabilities. Mixing them up can lead to data errors.

Comparison

${...}

$[...]

Time baseline

Business date (T-1)

Scheduling time (T)

Time precision

Day (year, month, day)

Second (year, month, day, hour, minute, second)

Offset calculation capability

Supports offsets for years, months, weeks, and days.

Supports offsets for days, hours, and minutes.

Core limitations

Does not support formatting or offset calculations for smaller units like hours, minutes, or seconds.

Does not support direct year or month offsets using syntax like $[yyyy±N] or $[mm±N]. Use the add_months function instead.

Default equivalence

${yyyymmdd} is equivalent to $bizdate

$[yyyymmddhh24miss] is equivalent to $cyctime

Time formatting

You can format the two time baselines by using ${...} or $[...] combined with time format specifiers such as yyyy, mm, and dd.

Code

Description

${...}

$[...]

Assignment

Result

Assignment

Result

yyyy

4-digit year

${yyyy}

2025

$[yyyy]

2025

mm

2-digit month

${mm}

10

$[mm]

11

dd

2-digit day

${dd}

31

$[dd]

01

hh24

Hour in 24-hour format

Not supported (day precision)

-

$[hh24]

02

hh / hh12

Hour in 12-hour format

-

$[hh]

02

mi

Minute

-

$[mi]

30

ss

Second

-

$[ss]

45

yyyymm

Get year and month

${yyyymm}

202510

$[yyyymm]

202511

yyyy-mm-dd

Format with hyphens

${yyyy-mm-dd}

2025-10-31

$[yyyy-mm-dd]

2025-11-01

yyyy-mm-dd hh24:mi:ss

Format with hyphens

Not supported (day precision)

-

See String Concatenation: Case 2 for supported methods.

Offset calculations

Offset calculations are the core of dynamic parameters, allowing you to add or subtract time from either the business date or scheduling time. For example, retrieve dates N years, months, or days before or after the baseline, or N hours or minutes (hours and minutes only supported for scheduling time). ${...} and $[...] support different ranges due to their different time baseline precisions.

  1. Offset calculation in ${...} mode

    • Core capability: Supports integer offsets for years, months, weeks, and days.

      Important

      Does not support hour or minute offsets. Syntax like ${yyyy-mm-dd-1/24} is not supported.

    • Syntax: ${<time_format><±N>}, where N corresponds to the smallest unit of the time format. For example, if the format is yyyymm, N represents months (mm); if the format is yyyymmdd, N represents days (dd).

      Date offset period

      Offset unit

      Method

      Example

      N years before/after

      Year

      ${yyyy±N} or ${yy±N}

      Previous year: ${yyyy-1}

      N months before/after

      Month

      ${yyyymm±N}

      Previous month: ${yyyymm-1}

      N weeks before/after

      Week

      ${yyyymmdd±7*N}

      Previous week: ${yyyymmdd-7*1}

      N days before/after

      Day

      ${yyyymmdd±N}

      Previous day: ${yyyymmdd-1}

  2. Offset calculation in $[...] mode

    • Core capability: Supports fractional offsets for days, hours, and minutes.

      Important

      The $[...] format does not support year or month offsets using formats like $[yyyy-N] or $[mm-N]. To perform offset calculations on years or months, use the add_months function instead.

    • Syntax: $[<time_format><±N>], where an hour offset is specified as N/24 and a minute offset is specified as N/24/60. N is the number of hours or minutes for the offset.

      Requirement

      Offset unit

      Method

      Example

      N years before/after

      Year

      $[add_months(yyyymmdd, 12*N)] (N years after) $[add_months(yyyymmdd, -12*N)] (N years before)

      Previous year: $[add_months(yyyymmdd, -12*1)]

      N months before/after

      Month

      $[add_months(yyyymmdd, N)] (N months after) $[add_months(yyyymmdd, -N)] (N months before)

      Previous month: $[add_months(yyyymmdd, -1)]

      N weeks before/after

      Week

      $[yyyymmdd±7*N]

      Previous week: $[yyyymmdd-7*1]

      N days before/after

      Day

      $[yyyymmdd±N]

      Yesterday: $[yyyymmdd-1]

      N hours before/after

      Hour

      Use formats such as $[hh24miss±N/24], $[hh24±N/24], and $[<custom_time_format>±N/24].

      Previous hour in different formats: $[mm-1/24], $[yyyy-1/24], $[yyyymm-1/24], $[yyyymmdd-1/24], $[yyyymmdd-1-1/24].

      N minutes before/after

      Minute

      Use formats such as $[hh24miss±N/24/60], $[yyyymmddhh24miss±N/24/60], $[mi±N/24/60], or $[<custom_time_format>±N/24/60].

      15 minutes before the scheduling time in different formats: $[yyyy-15/24/60], $[yyyymm-15/24/60], $[yyyymmdd-15/24/60], $[hh24-15/24/60], $[mi-15/24/60].

      Complex combined offset

      Day + Hour

      $[yyyymmdd±N±M/24], where N is the day offset and M is the hour offset.

      Example: Get the previous day and previous hour → $[yyyymmdd-1-1/24]

      Note

      When you perform offset calculations for hours and minutes, a cross-day issue may occur. For details on how to handle cross-day parameter replacements, see How do I handle cross-day parameter replacement when I subtract one hour from a scheduling parameter?.

Secondary transformations using engine functions

If the built-in features cannot generate the value you need (for example, getting the last day of the previous month), use the built-in functions of the target node's compute engine or an assignment node to perform a secondary transformation on the time parameter when calling it.

For more information, see Typical scenarios for secondary processing of scheduling parameter return values.

String concatenation

This method is used to construct specific date strings that are not supported by the built-in syntax. It combines the date part generated by a scheduling parameter with a fixed constant string.

Example 1: Dynamically retrieve the first day of every month.

  • Case: Regardless of which day a task runs, you need a string representing the first day of the current month in yyyymm01 format.

  • Implementation:

    1. Extract the year and month: Use ${yyyymm} to get the year and month of the current business date (for example, if the business date is 20231027, the result is 202310).

    2. Concatenate the extracted year and month with the string '01'.

    3. Parameter assignment: first_day_of_month=${yyyymm}01

  • Result: When the task runs, a call to ${first_day_of_month} returns 20231001.

Example 2: Retrieve a time in yyyy-mm-dd hh24:mi:ss format.

  • Case: Retrieve a time in yyyy-mm-dd hh24:mi:ss format, such as 2023-11-01 02:30:45.

  • Implementation:

    1. Set two parameters: datetime1 and datetime2, and assign them values datetime1=$[yyyy-mm-dd] and datetime2=$[hh24:mi:ss-1/24/60], respectively.

    2. Concatenate the parameters: Define a third parameter that concatenates datetime1 and datetime2 with a space.

    3. Parameter assignment: pt=${datetime1} ${datetime2}.

  • Result: When the task runs, a call to ${pt} returns 2023-11-01 02:29:45.

Built-in system parameters

DataWorks supports the system parameters listed in the table below, which can be used to set the values of scheduling parameters. However, this method offers less flexibility and uses fixed time formats. We recommend using custom time parameters, which support flexible transformations.

Built-in parameter

Definition

$bizdate

The business date, in yyyymmdd format. It has the same value as the custom parameter ${yyyymmdd}.

This parameter is widely used. In daily scheduling, the business date defaults to the day before the task's expected run time.

$cyctime

The task's scheduling time, in yyyymmddhh24miss format. It has the same value as the custom parameter $[yyyymmddhh24miss].

$gmtdate

The current date, in yyyymmdd format.

This parameter defaults to the current day. When you perform a data backfill operation, the value is the business date + 1.

$bizmonth

The business month, in yyyymm format.

  • If the month of the business date is the same as the current month, then $bizmonth = business date month - 1.

  • If the month of the Business Date is different from the current month, then $bizmonth = business date month.

$jobid

The ID of the workflow to which the task belongs.

$nodeid

The node ID.

$taskid

The instance ID generated by the node.

Appendix

Parameter replacement during data backfill

After you commit a task to Operation Center, you can perform a data backfill to batch generate and run historical task instances for a specified date range to complete data fixes, backfills, or retrospective analysis.

  • Business date: The business date selected for data backfill is consistent with the replacement result of $bizdate. If a scheduling parameter uses the ${...} custom format, its baseline is the selected date, transformed by the specified time expression.

  • Scheduling time: When you perform a data backfill, the replacement result for $cyctime is the selected business date + 1 day. For example, if the business date selected for the data backfill is 20250315, the value for the $cyctime parameter will be 20250316000000. If a scheduling parameter uses the $[...] format, its baseline is the selected business date + 1 day, transformed by the specified time expression.

Relationship between scheduling parameters, business date, scheduling time, and actual run time

Relationship

Description and example

Relationship between scheduling parameters and actual run time

A scheduling parameter's value is set when its instance is generated and does not change if the instance's actual run time is delayed.

Relationship between scheduling parameters and the task's scheduling time

When a scheduling parameter is set to $[...], its replacement value is determined by the instance's scheduling time, which is derived from the Scheduling Time in the node's scheduling configuration.

image

For example, if a node is scheduled hourly from 00:00 to 23:59, the first and second hourly instances have scheduling times of 00:00 and 01:00, resulting in hour parameter values of 00 and 01, respectively.

Relationship between scheduling parameters, business date, and scheduling time

image

About daylight saving time

DataWorks ensures that tasks run correctly on days when daylight saving time (DST) begins and ends. For details on how the product handles the DST transition, see Scenario: Impact of daylight saving time transitions on scheduled task execution. If you're in a region that observes DST, review this document to avoid confusion during the transition period.

References