The convertTimeFormat task converts a time value into a new format.
Use this task if a workflow requires you to take a specific record timestamp and convert it to a different time or date format, such as the quarter of the year, or to provide only the day of the year from a given date.
In this example:
inputTime property is provided by the output of getTime, a reference task located elsewhere in the workflow. The reference variable provided by the getTime task is time.newFormatString property is set to gg, which is the moment.js locale two-digit format for Week Year (1–52).convertedTime will be the week number of the year in which the inputTime value exists.
In this example:
inputTime property is provided by the output of getTime, a reference task located elsewhere in the workflow. The reference variable provided by the getTime task is time.newFormatString property is set to Qo, which is the moment.js format for Quarter. This format includes a trailing numeral abbreviation such as “1st”, “2nd”, “3rd”, or “4th”.convertedTime will be the quarter number for the calendar year in which the inputTime value exists. If the inputTime value is February 12, the resulting convertedTime value will be “2nd” Quarter.
To enter the inputTime object manually, use the format below for Year-Month-Date-Time (yyyy-MM-dd 'T' HH:mm:ss.SSSZ):
This format displays as: