ParseDate
The ParseDate action parses a date into a UNIX timestamp.
The ParseDate action is supported by the Java™ DateTimeFormatter. Some of the ParseDate action parameters are passed directly to Java.
The following table shows the parameters for the ParseDate action.
Name | Data type | Required | Notes |
---|---|---|---|
pattern | String | Yes | The formatting pattern to use. See Java DateTimeFormatter for possible values. |
timeZone | String | No | The time zone to use. See Java DateTimeFormatter for possible values. |
date | String | Yes | The formatted date to parse. |
savePath | JPath | Yes | The location to store the result. |
XML Example:
This action converts the timestamp that is stored in the State at location /formatted_time to a UNIX timestamp and stores it in the State at location /timestamp. The current timestamp must be in the yyyy-MM-dd'T'HH:mm:ss'Z' format and represent a time in the Coordinated Universal Time (UTC) zone.
<ParseDate pattern="yyyy-MM-dd'T'HH:mm:ss" timeZone="UTC" time="${/formatted_time}"
savePath="/timestamp" />