DateTimeConverterValve
Note
Converts a date/time value from one format to another.
Source value supported formats:
- ISO instant: 2020-02-03T10:16:16.441Z
- ISO offset: 2020-02-03T11:30:00.000+01:00
- ISO local time (no timezone, system default is used): 2020-02-03T11:30:00.000
- JDBC timestamp: 2020-02-03 11:30:00
- Custom format specified by property src_format
Output format is by default ISO instant but can be customised using dest_format property.
Conversion can also modify the date/time value using a duration in ISO-8601 duration format PnDTnHnMn.
Properties
Name | Description | Default value | Mandatory | Supports property expansion |
---|---|---|---|---|
src | The date/time value to convert | Yes | Yes | |
src_format | The format of the source value | No | No | |
src_tz | The timezone of the source value (if not included in value) | No | No | |
dest | The item property (or flow attribute if no items exist) to receive the converted date/time. | Yes | No | |
duration | Duration to add/remove from the date/time. | No | No | |
dest_format | Date/time pattern of convertion result | ISO instant format | No | No |
Example Configuration
{
"name":"DateTimeConverterValve",
"config": {
"src":"{{item.timestamp}}",
"src_format": "yyyy/MM/dd HH.mm.ss",
"dest":"result",
"duration":"-PT2H",
"dest_format":"yyyy-MM-dd HH:mm:ss"
}
}