Date & Time states follow Java 8 DateTime formats.
Pattern | Description | Example |
yyyy | Four-digit year | 2025 |
MM | Month as a two-digit number | 03 |
MMM | Month as abbreviated name | Mar |
MMMM | Month as full name | March |
dd | Day of the month | 15 |
HH | Hour in 24 hour format (00–23) | 14 |
hh | Hour in 12 hour format (01–12) | 02 |
mm | Minute | 45 |
ss | Second | 30 |
SSSSSSSSS | Nanoseconds | 000000000 |
'T' | ISO-8601 literal separator between date and time | 2025-03-15T14:45:30 |
Nanoseconds are returned only if present in the input; otherwise, the value defaults to zero.
Duration values follow the ISO-8601 pattern:
P(n)DT(n)H(n)M(n)S
P – Indicates the start of the duration period
D – Number of days
T – Separates date and time components
H – Number of hours
M – Number of minutes
S – Number of seconds
Example:
P2DT3H15M10S - Represents 2 days, 3 hours, 15 minutes, and 10 seconds.
Below are the states available in the Date & Time.
Adds a specified duration to a given date or time value.
Builder View Payload Configuration
Date Time: Date or date time value (static or dynamic).
Input: Specify the input format, time zone, and locale.
Duration: Duration to be added to the input date time.
Output: Define the output format, time zone, and locale.
Code View
{
"Add Duration": {
"module": "datetime",
"task_id": "add",
"payload": {
"datetime": "2025-08-25",
"input": {
"format": "yyyy-MM-dd",
"zone": "Asia/Kolkata"
},
"output": {
"format": "dd-MMMM-yyyy",
"zone": "UTC",
"locale": "fr-FR"
},
"duration": "P2D"
},
"next": "End"
}
}
Subtracts a specified duration from a given date or time value.
Builder View Payload Configuration
Date Time: Specify the date time value (static or dynamic, for example $.time).
Input: Specify the input format, time zone, and locale.
Duration: Duration to be reduced from the input date time.
Output: Define the output format, time zone, and locale.
Code View
{
"Add Duration": {
"module": "datetime",
"task_id": "subtract",
"payload": {
"datetime": "2025-08-25",
"input": {
"format": "yyyy-MM-dd",
"zone": "Asia/Kolkata"
},
"output": {
"format": "dd-MMMM-yyyy",
"zone": "UTC",
"locale": "fr-FR"
},
"duration": "P2D"
},
"next": "End"
}
}
Converts date or time values into a specified string format.
Builder View Payload Configuration
Configure the following payload:
Date Time: Specify the date time value (static or dynamic, for example $.time).
Input: Specify the input format, time zone, and locale.
Output: Define the output format, time zone, and locale.
Code View
{
"Format Date": {
"module": "datetime",
"task_id": "format",
"payload": {
"datetime": "2025-08-25",
"input": {
"format": "yyyy-MM-dd",
"zone": "Asia/Kolkata"
},
"output": {
"format": "dd-MMMM-yyyy",
"zone": "UTC",
"locale": "fr-FR"
}
},
"next": "End"
}
}
Calculates the time difference between two date or time values.
Builder View Payload Configuration
Configure the following payload:
Start Date Time: Provide the start date time values.
End Date Time: Provide the end date time values.
Input: Specify the input format, time zone, and locale.
Units: Specifies the unit in which the result is returned (for example, days, hours, minutes).
Code View
{
"Date Difference": {
"module": "datetime",
"task_id": "difference",
"payload": {
"start_datetime": "2025-08-25",
"end_datetime": "2025-10-25",
"input": {
"format": "yyyy-MM-dd",
"zone": "Asia/Kolkata"
},
"units": ["days", "hours", "minutes"]
},
"next": "End"
}
}
Retrieves the current date and time during circuit execution.
Example Use Case
This state can be used to timestamp records or logs at runtime.
Builder View Configuration
Configure the following payload:
Output: Specify the input format, time zone, and locale
Include Time:
Enabled → returns current date and time
Disabled → returns start of the day
Code View
{
"Current Datetime": {
"module": "datetime",
"task_id": "current_datetime",
"payload": {
"output": {
"format": "dd-MMMM-yyyy",
"zone": "UTC",
"locale": "fr-FR"
},
"include_time": true
},
"next": "End"
}
}
Builder View Payload Configuration
Configure the following payload:
Duration: Enter the duration
Units: Specifies the unit in which the result is returned (for example, days, hours, minutes).
If units are not selected, the result is returned as a duration.
Code View
{
"Extract Duration": {
"module": "datetime",
"task_id": "extract_duration",
"payload": {
"duration": "P2DT5H7M",
"units": ["hours", "minutes", "seconds"]
},
"next": "End"
}
}
Retrieves specific date or time components from a datetime value.
Builder View Payload Configuration
Configure the following payload:
Datetime: In this key only the date time will be passed dynamically (Ex:$.time).
Input: Specify the input format, time zone, and locale.
Units: Select the unit from dropdown. The retrieved date time is returned as selected units.
Code View
{
"Extract Datetime": {
"module": "datetime",
"task_id": "extract_datetime",
"payload": {
"datetime": "2025-10-25",
"input": {
"format": "yyyy-MM-dd",
"zone": "Asia/Kolkata"
},
"units": ["days", "hours", "minutes"]
},
"next": "End"
}
}
You are currently viewing the help articles of Qntrl 3.0. If you are still using our older version and require guidance with it, Click here.