This guide shows how to take a UNIX timestamp (e.g. `1600259200`), add one day to it and present it in a readable DateTime format (e.g. `YYYY-MM-DD`). For this guide we assume the UNIX timestamp originates from an event parameter, but it can also come from elsewhere - user attribute or Linked Data, to name a few examples.
Steps:
- Get the event parameter with the following JINJA code
{{ parameter.testParam }}
- Convert the timestamp to a time parameter object with the sectotime JINJA function:
{{ parameter.testParam | sectotime }}
- Add one additional day to the time parameter via the plus_time function:
{{ parameter.testParam | sectotime| plus_time(1,'days')}}
- Format the time to `YYYY-MM-DD` format with the datetimeformat function:
{{ parameter.testParam | sectotime| plus_time(1,'days') |datetimeformat("%y-%m-%d")}}
As a result, the timestamp parameter(`1600259200`) will be displayed as `20-09-18` in the message.