Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Date and time transform functions

Use date and time transform functions to recalculate or reformat data pills for Date/Time values.

Date and time transform functions require a Date/Time or String input data pill. Some functions also support Duration data pills. Make sure to use the correct input data pill type when applying date and time transform functions. If a date and time transform function is applied to an improper data pill type, the data is not transformed at runtime and the input value is returned instead. For more information on confirming your flow runtime values, see Test a flow.

Note: Runtime Date/Time values are not localized and appear in the UTC (Coordinated Universal Time) time zone. For more information, see Time zones and time zone representation.

Add Time

Adds days, hours, minutes, or seconds to an input Date/Time, Date, Due Date, or Duration.

Input data pillParametersOutput data pill
Date/Time, Date, Due Date, or DurationNote: If the input is a Date or Due Date, the transform creates a full Date/Time value using time values of hour 0, minute 0, and second 0.Duration - Amount of time to add in days, hours, minutes, and secondsDate/Time - Transformed Date/Time value after adding the specified Duration
  • Input: 2019-09-12 11:00:00
  • Duration: 3 hours
  • Output: 2019-09-12 14:00:00

Subtract Time

Subtracts days, hours, minutes, and/or seconds from the input Date/Time, Date, Due Date, or Duration.

Input data pillParametersOutput data pill
Date/Time, Date, Due Date, or DurationNote: If the input is a Date or Due Date, the transform creates a full Date/Time value using time values of hour 0, minute 0, and second 0.Duration - Enter an amount of time to subtract in days, hours, minutes, and secondsDate/Time - Transformed Date/Time value after subtracting the specified Duration
  • Input: 2019-09-12 11:00:00
  • Duration: 2 days, 1 hours, 5 minutes, 10 seconds
  • Output: 2019-09-10 09:54:50

In this example, the flow retrieves a CMDB Configuration Item record from a remote instance. The Subtract Time transform function then localizes the value of the Created field by subtracting three hours from the input Date/Time.

Image omitted: subtract-time-transform-function-example.png
Localize a field value's time zone.

String to Date

Converts the input String to a Date/Time.

Input data pillParametersOutput data pill
String formatted as specified in the Input Date Format
  • Input Date Format - Date/Time or date format of the input String
  • Custom Format - Valid Date/Time or date format represented as a String. Required only if Custom Format is selected as the Input Date Format.
Date/Time

Note:

  • If the Date/Time value for the Custom Format input is incomplete, the transform creates a full Date/Time value using default dates and times. In such a case, the transform defaults to the current year, the current month, day 1 of a month, hour 0, minute 0, and second 0. For example, an input data pill value of Oct 2019 and a custom date format of MMM yyyy produces an output of 2019-10-01 00:00:00.
  • If you use an incorrect data pill type or invalid Custom Format, the flow cancels during runtime.

  • Input: '1995-11-20'

  • Input Date Format: ISO Date (2004-06-28)
  • Output: 1995-11-20 00:00:00

Date to String

Converts the input Date/Time, Date, or Due Date to a String. Select a Date Format for the input Date/Time. Alternatively, enter a Custom Format for the input Date/Time.

Input data pillParametersOutput data pill
Date/Time, Date, or Due Date
  • Output Date Format - Date/Time or date format of the output String
  • Custom Format - Valid Date/Time or date format represented as a String. Required only if selecting Custom Format as the Date Format.
String formatted as specified in the Output Date Format

Note: If you use an incorrect input data pill type or invalid Custom Format, the flow cancels during runtime.

  • Input: 1969-12-31 14:23:57
  • Output Date Format: Custom (enter below)
  • Custom Format: 'On' MMM dd, yyyy 'at' hh:mm a
  • Output: 'On Dec 31, 1969 at 2:23 PM'

In this example, the flow retrieves a User [sys_user] record from a third-party database. The Date to String transform function converts the format of the Created field and then logs the date, time, and name that is associated with the record.

Image omitted: date-to-string-transform-function-example.png
Concatenate a Date/Time value with a String value.

Custom date formats

You can specify a custom date format with a sequence of specific date and time pattern strings. A pattern string consists of one or more uppercase and lowercase letters from A to Z. Any text within quotation marks is ignored and is instead copied into the date output.

StringDescriptionOutput FormatExample
GEra designatorTextAD
yYearYear2019; 19
YWeek in yearYear2019; 19
MMonth in year (within date)MonthJuly; Jul; 07
LMonth in year (standalone value)MonthJuly; Jul; 07
wWeek in yearNumber52
WWeek in monthNumber1
DDay in yearNumber365
dDay in monthNumber2
FDay of week in monthNumber3
EDay name in weekTextWednesday; Wed
uDay number of weekNumber3
aa.m. or p.m.Textp.m.
HHour in day from 0 through 23Number0
kHour in day from 1 through 24Number24
KHour in a.m. or p.m. from 0 through 11Number0
hHour in a.m. or p.m. from 1 through 12Number12
mMinute in hourNumber59
sSecond in minuteNumber1
SMillisecondNumber500
zTime zone in default formatTime zone in default formatPacific Standard Time; PST
ZTime zone in RFC 822 formatTime zone in RFC 822 format-0800
XTime zone in ISO 8601 formatTime zone in ISO 8601 format-08; -0800; -08:00

Day

Retrieves the day component from the specified Date/Time.

Input data pillOutput data pill
Date/TimeInteger - Day from the specified date.
  • Input: 2021-11-20 13:06:12
  • Input Date Format: ISO Date (2004-06-28)
  • Output: 20

Hour

Retrieves the hour component from the specified Date/Time.

Input data pillOutput data pill
Date/TimeInteger - Hour from the specified date.
  • Input: 2021-11-20 13:06:12
  • Input Date Format: ISO Date (2004-06-28)
  • Output:13

Minute

Retrieves the minute component from the specified Date/Time.

Input data pillOutput data pill
Date/TimeInteger - Minute component from the specified date.
  • Input: 2021-11-20 13:06:12
  • Input Date Format: ISO Date (2004-06-28)
  • Output: 06

Second

Retrieves the second component from the specified Date/Time.

Input data pillOutput data pill
Date/TimeInteger - Second component from the specified date.
  • Input: 2021-11-20 13:06:12
  • Input Date Format: ISO Date (2004-06-28)
  • Output: 12

Month

Retrieves the month component from the specified Date/Time.

Input data pillOutput data pill
Date/TimeInteger - Month component from the specified date.
  • Input: 2021-11-20 13:06:12
  • Input Date Format: ISO Date (2004-06-28)
  • Output: 11

Week

Evaluates the week number for the specified Date/Time.

Input data pillOutput data pill
Date/TimeInteger - Week number for the specified date.
  • Input: 2021-04-07 12:01:12
  • Input Date Format: ISO Date (2004-06-28)
  • Output: 15

Year

Retrieves the year component from the specified Date/Time.

Input data pillOutput data pill
Date/TimeInteger - Year component from the specified date.
  • Input: 2021-04-07 12:01:12
  • Input Date Format: ISO Date (2004-06-28)
  • Output: 2021

Date Difference

Evaluates the time duration difference between the specified input date and the parameter date and then adds the difference time duration to the Epoch time (1970-01-01 00:00:00).

Input data pillParametersOutput data pill
Date/Time, Date, or Due DateDate/Time, Date, or Due DateDuration - Time duration difference added to the Epoch time (1970-01-01 00:00:00).
  • Input: 2021-05-02 09:10:12
  • Input Date Format: ISO Date (2004-06-28)
  • Parameters: 2021-04-07 06:02:23
  • Output: 1970-01-26 03:07:49

End of Month

Evaluates the last day of the month after adding the specified number of the months to the specified date.

Input data pillParametersOutput data pill
DateNumber of Months - Months to add to the specified date.Integer - Last day of the month after adding the number of months to the specified input date.
  • Input: 2021-11-20
  • Input Date Format: ISO Date (2004-06-28)
  • Number of Months: 3
  • Output: 2022-02-28

Parent Topic:Transform functions