Klevr Product Documentation logo

Transform DateTime Stage

The Transform DateTime stage allows date/time values in a message to be converted to a different time zone or date format.

Stage Overview

The Transform DateTime stage allows either an empty object, or an object filled with attributes containing date/time values to be converted to a different time zone and/or date format.

Stage Definition File Location

All Transform DateTime stages are defined by creating an appropriately formatted JSON definition file in the following location:

interfaces
{businessUnitCode}
{domainCode}
{integrationName}
tr
dt
{STAGE_NAME}.json

Stage JSON Definition File Format

The JSON definition file for a Transform DateTime stage is as follows:

{
  "name": "stage-name",
  "displayName": "Brief Stage Title",
  "description": "Brief description of the stage.",
  "enabled": "$env:STATUS_<INTEGRATION_NAME>",
  "source": "source-event",
  "concurrency": 10,
  "inputTimeZone": "New Zealand Standard Time",
  "outputTimeZone": "AUS Eastern Standard Time",
  "timestampFormat": "Optional date/time format to use when converting"
}
PropertyDescription
nameThe name of the stage.
displayNameOptional (but highly recommended). A short (3 or 4 word) "display name" for the stage, used as a "title" of the stage in the Integration Hub Portal service's self-documentation capability.
descriptionOptional (but highly recommended). A brief (10 to 15 word) description of the stage, used as a brief description of the stage's purpose in the Integration Hub Portal service's self-documentation capability. For a more detailed explanation (when needed), use the stage markdown feature.
enabledOptional boolean flag (true or false). Default is true.

Generally set via a DevOps variable. Controls if the stage is deployed enabled or not.
sourceThe source event that the stage subscribes to. See Pub/Sub Model.

Alternatively, sources may be supplied, and an array of one or more source events can be subscribed to.
concurrencyOptional number of concurrent runs permitted for the stage. Default is 10.
inputTimeZoneSupplied payload date/time values are in this time zone.
outputTimeZoneOutput payload date/time values will be converted to this time zone.
timestampFormatThis is the date/time format that the converted times will be output in. By default the format will be "YYYY-MM-DD HH:MM:SS", but other formatting options are available.

Tips and Tricks

Only payloads with attributes containing date/time values can be sent to this stage. If a "currentDateTime" attribute does not exist in the incoming payload (including if the payload is empty) then this attribute will be added to the output payload from the stage.

Last updated on