Format Date and Time
This action lets you use customized date and time in your workflow. To achieve this, add this action and configure it. You can select one of the three format types (Standard, Relative, and Calendar) for get date/time in a variety of formats. Let’s look at each of these formats individually to understand them better.
Select a language from the list given under ‘Set Locale’. This will give the resultant date and time in the selected language in output.
In the ‘Set Time’ field, enter a custom date in YYYY-MM-DD format, and provide time details in ‘Set Hours’, ‘Set Minutes’, and ‘Set Seconds’ fields. If you enter ‘now’ (default) in the ‘Set Time’ field, Built.io Flow will record the date and time of the execution of the workflow. In such a case, you need not enter time details in ‘Set Hours’, ‘Set Minutes’, and ‘Set Seconds’ fields.
If you wish to get a date/time that comes after or before the date/time entered in ‘Set Time’ (workflow execution time), you can enter values in ‘Add Milliseconds’ or ‘Subtract Milliseconds’.
So, for example, if you wish to get a time that should be 4 hours from the time of workflow execution, you need to enter ‘now’ in the ‘Set Time’ field, and enter ‘14400000’ in ‘Add milliseconds’.
You also need to define the output date format by selecting an option listed under ‘Preset format’. If you wish to get the date/time in a custom format, select ‘none’ under preset format, and enter a custom format in the ‘Set Custom Format’ field.
You can learn more about various custom formats by visiting this page.
This helps you display time (in humanized format, such as ‘3 months ago’) in relation to now. To do this, select ‘Relative’ under ‘Format Type’. Select the language in which you wish to get the output date/time.
Then, select one of the options listed under ‘Start Of (from now)’ or ‘End Of (from now)’. ‘Start of’ will take the start of the current year, month, week, day, or hour, and return the difference from ‘now’. Similarly, ‘End of’ takes the end of the selected parameter.
So, for instance, if you select ‘Year’ under ‘Start Of (from now)’, and if the current date is March 31, 2016, the output will be ‘3 months ago’. In case of ‘End of’, the output will be ‘in 9 months’.
The ‘Calendar’ Format Type lets you set a date and time in an easy manner. You can enter a standard date in YYYY-MM-DD format in the ‘Set Custom Time’ field. Alternatively, you can get a date/time that comes after or before the date/time specified in ‘Set Custom Time’. To do this, enter ‘now’ or a specific date/time in ‘Set Custom Time’ field, and enter values in ‘Subtract’ or ‘Add’.
So, for instance, if you specify ‘now’, and enter ‘10’ in ‘Subtract’ and set ‘Subtract Time Unit’ as ‘years’, the output will be 03/31/2016.
Format Date and Time
- moment string