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 hard-code 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 and how to use them.
Before you read this topic, make sure you understand how to configure scheduling parameters. For more information, see Configure and use scheduling parameters.
Core concepts: Time baselines
Time parameters are the primary use case for scheduling parameters. They are used to dynamically replace various time strings when a task runs. All dynamic time parameters in DataWorks are based on the following two core time baselines.
Concept | Definition | Default parameter value | Custom format | Time precision |
Business date | The date of the data being processed, which is the day before the task's scheduled run date. In T+1 offline computing scenarios, this represents the date when the business data occurred. For example, if you calculate yesterday's sales revenue today, yesterday is the date when the transactions occurred, which is the business date. |
|
| Year, month, day |
Scheduling time | The scheduling time set in the scheduling configuration. When a task runs, the system replaces this with the date on which the task instance runs (today). It is the theoretical run time of the task and does not shift due to resource queuing or delays during the actual run. |
|
| Year, month, day, hour, minute, second |
Concept equivalence 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).
Parameter value expressions
Scheduling parameters support multiple assignment types, including the following:
Custom time parameters: Such as
${...}and$[...], which can be transformed based on the two time baselines (business date and scheduling time). For more information, see Custom time parameters.Built-in system parameters: Such as
$bizdate,$bizmonth, and$jobid, which you can use to retrieve the business date, business month, workflow ID, and other information. They are not limited to time-based values. For more information, see Built-in system parameters.Constants: Such as
'123'and'abc'.
Special character restriction: Parameter expressions do not support spaces or the = character.
Basic usage principles
You can define the assignment logic for scheduling parameters by setting a parameter name and a parameter value in the section. After you define a parameter, you can reference it in your code using the ${parameter_name} format. For more information about how to configure parameters, see Configure and use scheduling parameters.
You can directly use the built-in system parameters
$bizdateand$cyctimefor the business date and scheduling time, respectively. They are equivalent to the following:$bizdate=${yyyymmdd}$cyctime=$[yyyymmddhh24miss]

The figures compare the parameter definitions for $bizdate and ${yyyymmdd}, and for $cyctime and $[yyyymmddhh24miss]. The figures also show the preview results when the business date is October 16, 2025.
If the return values of the baseline time parameters do not meet your requirements, you can create custom time parameters using
${...}and$[...]. Custom time parameters are transformations based on the two time baselines.
Custom time parameters
DataWorks lets you use ${...} and $[...] to retrieve the business time and scheduling time. It also supports transformations to adjust the time as needed. The following examples assume that the node is configured with daily scheduling and a scheduling time of 02:30:45. If the business date is 20251031, the baseline times are as follows:
Business date: The value of ${yyyymmdd} is 20251031.
Scheduling time: The value of $[yyyymmddhh24miss] is 20251101023045.
Core differences between ${...} and $[...]
The ${...} and $[...] formats have fundamental differences in their time baselines and calculation capabilities. Using the wrong format will cause 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 | You cannot format or calculate offsets for smaller time units such as hours, minutes, or seconds. | Does not support direct year or month offsets using syntax such as |
Equivalent system parameters |
|
|
Time formatting
You can use curly braces ${...} or square brackets $[...] combined with a custom combination of yyyy, yy, mm, and dd to generate time parameters. This lets you retrieve dates N years, months, or days before or after the business date.
Code | Description |
|
| ||
Assignment method | Result | Assignment method | Result | ||
| 4-digit year |
|
|
|
|
| 2-digit month |
|
|
|
|
| 2-digit day |
|
|
|
|
| Hour in 24-hour format | Not supported (day precision) | - |
|
|
| Hour in 12-hour format | - |
|
| |
| Minute | - |
|
| |
| Second | - |
|
| |
| Get year and month |
|
|
|
|
| Format with hyphens |
|
|
|
|
| Format with hyphens, including time | Not supported (day precision) | - | For supported methods, see String Concatenation: Case 2. | |
Offset calculations
Offset calculation is a core feature of dynamic parameters that lets you add or subtract time from the business date or scheduling time. For example, you can retrieve dates N years, months, or days before or after the baseline. You can also retrieve times N hours or minutes before or after the baseline, but this is supported only for scheduling time. The ${...} and $[...] formats support different ranges because they have different time baseline precisions.
Offset calculation in
${...}modeCore capability: Supports integer offsets for years, months, weeks, and days.
ImportantHour or minute offsets are not supported. For example, syntax such as ${yyyy-mm-dd-1/24} is invalid.
Syntax:
${<time_format><±N>}. In this format, N corresponds to the smallest unit of the time format. For example, if the format is yyyymm, N represents an offset in months (mm). If the format is yyyymmdd, N represents an offset in 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}Day before yesterday:
${yyyymmdd-1}
Offset calculation in
$[...]modeCore capability: Supports fractional offsets for days, hours, and minutes.
ImportantThe
$[...]format does not support year or month offsets using formats such as$[yyyy-N]or$[mm-N]. To perform offset calculations on years or months, use theadd_monthsfunction.Syntax:
$[<time_format><±N>]. To specify an hour offset, use N/24. To specify a minute offset, use N/24/60. In these expressions, N is the number of hours or minutes for the offset.Scenario
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)]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
Available formats:
$[hh24miss±N/24],$[hh24±N/24]$[Custom time format±N/24].
Previous hour in different formats:
Month:
$[mm-1/24].Year:
$[yyyy-1/24].Year and month:
$[yyyymm-1/24].Year, month, and day:
$[yyyymmdd-1/24].Previous day and previous hour:
$[yyyymmdd-1-1/24]
N minutes before/after
Minute
Available formats:
$[hh24miss±N/24/60]$[yyyymmddhh24miss±N/24/60]$[mi±N/24/60]$[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]NoteWhen you perform offset calculations for hours and minutes, a cross-day issue may occur. For more information about 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?.
When you perform a month offset calculation on a month-end date, if the target month does not have that date, the result is automatically calibrated to the last day of the target month. For example, if the current date is 2025-03-31 and you subtract one month, the result is 2025-02-28 because February does not have a 31st day.
Secondary transformations using engine functions
If the built-in formatting and offset features cannot generate the value you need (for example, retrieving the last day of the previous month), you can 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 you call it.
For more information, see Typical scenarios for secondary processing of scheduling parameter return values.
String concatenation
You can use this method to construct specific date strings that are not supported by the built-in syntax but follow a regular pattern. This method combines the date part generated by a scheduling parameter with a fixed constant string.
Case 1: Dynamically retrieve the first day of every month.
Scenario: Regardless of which day a task runs, you need a string representing the first day of the current month in
yyyymm01format.Implementation:
Extract the year and month: Use
${yyyymm}to retrieve the year and month of the current business date. For example, if the business date is20231027, the result is202310.Concatenate a constant: Concatenate the extracted year and month with the string
'01'.Parameter call:
first_day_of_month=${yyyymm}01
Result: When the task runs,
${first_day_of_month}is replaced with20231001.
Case 2: Retrieve a time in yyyy-mm-dd hh24:mi:ss format.
Scenario: You need to obtain a time in the
yyyy-mm-dd hh24:mi:ssformat, such as2023-11-01 02:30:45.Implementation:
Set the
datetime1parameter todatetime1=$[yyyy-mm-dd]and thedatetime2parameter todatetime2=$[hh24:mi:ss-1/24/60].Concatenate the parameters: Concatenate
datetime1anddatetime2with a space.Parameter call: pt=
${datetime1}${datetime2}.
Result: When the task runs,
${datetime1}${datetime2}is replaced with2023-11-01 02:30:45.
Built-in system parameters
DataWorks supports the following system parameters, which you can use to set the values of scheduling parameters. However, this method offers less flexibility and uses fixed time formats. We recommend that you use custom time parameters because they support flexible transformations.
Built-in parameter | Definition |
$bizdate | The business date, in 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 |
$gmtdate | The current date, in This parameter defaults to the current day. When you perform a data backfill operation, the value is the |
$bizmonth | The business month, in
|
$jobid | The ID of the workflow to which the task belongs. |
$nodeid | The node ID. |
$taskid | The instance ID generated by the node. |
Parameter replacement examples in actual scenarios
A scheduling parameter's replacement value is determined when the instance is generated and does not change based on the instance's actual start time. This principle applies to all scenarios.
Scenario 1: Normal scheduling
In a normal automated scheduling scenario, the parameter replacement logic corresponds directly to the two time baselines: the business date and the scheduling time.
${...}(business date): Its value is determined by the instance's own business date.$[...](scheduling time): Its value is determined by the instance's own scheduling time.
Example: Assume a daily scheduling task A is scheduled to run at 00:00 every day and has two parameters configured:
yesterday=${yyyymmdd}today=$[yyyymmddhh24miss]
The following table shows the replacement logic for one of its instances.
Instance's scheduling time | Instance's business date | Parameter: yesterday=${yyyymmdd} | Parameter: today=$[yyyymmddhh24miss] |
|
|
|
|
Scenario 2: Data backfill
When you manually run a data backfill task, the parameter replacement logic changes based on the manually selected business date, especially for the scheduling time.
${...}(business date): Its baseline is the manually selected business date.$[...](scheduling time): Its baseline is the manually selected business date + 1 day.
Example: Assume you manually run a data backfill for the same task A and select the business date 2025-03-15.
Manually selected business date | Parameter: yesterday=${yyyymmdd} | Parameter: today=$[yyyymmddhh24miss] |
|
|
|
FAQ
For answers to common questions about using scheduling parameters, see Scheduling parameters FAQ.