This article explains how to use the Date/Time Formatter action to reformat a date value or add and subtract time from it, including timezone conversion, within HappyFox Workflows.
Applicable Plans: Available on all plans.
The Date/Time Formatter is a native Workflows action, available in any workflow regardless of which app or integration triggers it — the same way Perform Math Operations and Transform Text are.
Available options
The action has one required setting, Transformations, which determines which fields appear next.
| Option | What it does |
|---|---|
| Add/Subtract Date | Adds or subtracts a duration (days, hours, minutes, and so on) from the input date and returns the result in the selected output format. |
| Format Date | Converts the input date from one format to another, and optionally converts it to a different timezone, without adding or subtracting any time. |
Both transformations share the same set of underlying fields:
| Field | Required | Description |
|---|---|---|
| Date To Transform | Yes | The input date or timestamp to work with. Accepts a merge field or a static value. |
| From Format | Yes | Tells the action how to read the input date. Selected from the supported format list below. |
| To Format | Yes | Tells the action how to output the final date. Selected from the supported format list below. |
| From Timezone | No | The timezone the input date should be interpreted in. |
| To Timezone | Yes | The timezone to convert the final date into. |
| Duration | Required for Add/Subtract Date only | The amount of time to add or subtract, for example +9 hours 1 minute or 1 day +7 hours. |
Supported date formats
From Format and To Format are selected from a fixed list, not typed as free text:
| Format | Example |
|---|---|
| MMMM DD YYYY | January 22 2006 |
| MMM DD YYYY | Jan 22 2006 |
| YYYY-MM-DDTHH:mm:ssZ | 2006-01-22T23:04:05-0000 |
| YYYY-MM-DD HH:mm:ss Z | 2006-01-22 23:04:05 -0000 |
| YYYY-MM-DD | 2006-01-22 |
| MM-DD-YYYY | 01-22-2006 |
| MM/DD/YYYY | 01/22/2006 |
| MM/DD/YY | 01/22/06 |
| DD-MM-YYYY | 22-01-2006 |
| DD/MM/YYYY | 22/01/2006 |
| DD/MM/YY | 22/01/06 |
| Unix Timestamp | 1137971045 |
| Relative Date | Today, Tomorrow, Yesterday |
Note: Relative Date output (Today, Tomorrow, Yesterday) is available as a To Format option only. It is not a valid From Format, since a relative label cannot be parsed as an input date.
How to use it
- Add the Date/Time Formatter action to your workflow.
- Select a transformation from the Transformations dropdown — Add/Subtract Date or Format Date.
- Click Insert Merge Fields next to Date To Transform and select the date value to work with.
- Click Insert Merge Fields next to From Format and select the format that matches your input date.
- Click Insert Merge Fields next to To Format and select the format you want the output in.
- Click Insert Merge Fields next to From Timezone and select the timezone the input date is in.
Note: Although From Timezone is optional, always specify a value. Leaving it blank makes the input date's timezone ambiguous, which can produce an unexpected result after conversion.
- Click Insert Merge Fields next to To Timezone and select the timezone to convert the output into.
- If you selected Add/Subtract Date, click Insert Merge Fields next to Duration and enter the amount of time to add or subtract, for example
1 day +7 hours. - Save the action.
Note: Use a negative value to subtract time, and a positive value (or no sign) to add it. The sign can be set per unit within the same string — for example,
+1 month -2 daysadds one month and subtracts two days in a single Duration value. Supported units include hours, minutes, days, and months. Other examples:+9 hours 1 minute,-1 day +7 hours.
Note: If the output doesn't look right, check Run History for the step's result. Run History shows whether the action failed or what value it produced, which helps confirm whether the input date matched the selected From Format and whether the Duration value was entered correctly.
The formatted or shifted date is available as a merge field in any action that follows this one in your workflow.
Your Date/Time Formatter action is now configured and its output is available for use in later steps. Next, see how to create date-based conditions and triggers to compare or filter on this value elsewhere in your workflow.