FormatDate

The FormatDate action formats a UNIX timestamp to a date.

The following table shows the parameters for the FormatDate action.

Table 1. FormatDate action parameters
Name Data type Required Notes
pattern String Yes

See Java™ DateTimeFormatter for possible values.

timeZone String No

See Java DateTimeFormatter for possible values.

time Number No The time to format, in milliseconds since epoch. The default is the current time.
savePath JPath Yes The location to store the result.

XML Example

This action extracts the UNIX timestamp currently stored in the State at /bookmark and converts it to a meaningful timestamp in the following format in the UTC time zone.
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
<FormatDate pattern="yyyy-MM-dd'T'HH:mm:ss" timeZone="UTC" time="${/bookmark}"
savePath="/formatted_bookmark" />

The reformatted value is saved in the State at /formatted_bookmark.