Parse and Format Date Function Calls

Last modified: November 26, 2025

Introduction

This document describes functions that are used to parse Date and time values from strings using a specified pattern, or to produce a string from a Date and time value.

The following pattern letters can be used to parse and format Date and time values:

LetterDate or Time ComponentExamples
MMonth in year, digit1
MMMonth in year, digit with leading zero01
MMMMonth in year, abbreviated (context sensitive)Nov
MMMMMonth in year (context sensitive)November
LMonth in year, digit (standalone), digit1
LLMonth in year, digit with leading zero01
LLLMonth in year, abbreviated (standalone)Nov
LLLLMonth in year (standalone)November
yyCalendar year, two digits01
yyyyCalendar year, four digits2022
YYYYISO week-numbering year, four digits:
YYYY shows the year based on the ISO week the date falls in, where week 1 is the first week containing at least four days of the new year. For example, 2024-12-31 is in ISO week 1 of 2025, so YYYY returns 2025, while yyyy returns 2024.
2022
GEra designatorAD
EDay name in week, abbreviatedTue
EEEEDay name in weekTuesday
uDay of week (1 = Monday, ..., 7 = Sunday)5
wWeek in year11
WWeek in month2
DDay in year133
dDay in month7
FDay of week in month1
aAm/pm markerPM
HHour in day (0-23)0
kHour in day (1-24)24
KHour in am/pm (0-11)0
hHour in am/pm (1-12)12
mMinute in hour24
sSecond in minute50
SMillisecond201

The following pattern letters are only available for microflows:

LetterDate or Time ComponentExamples
zTime zonePacific Standard Time; PST; GMT-08:00
ZTime zone-0800
XTime zone-08; -0800; -08:00

parseDateTime[UTC]

Takes a string and parses it. If it fails and a default value is specified, it returns the default value. Otherwise, an error occurs. The function parseDateTime uses the user's time zone and parseDateTimeUTC uses the UTC calendar.

Input Parameters

The input parameters are described in the table below:

ValueType
DateA string which contains the textual representation of a date — for example dd/MM/yyyy or MM/dd/yyyy
FormatString
Default value (optional)Date and time

Output

The output is described in the table below:

ValueType
The parsed date or the default value if a date could not be parsed.Date and time

Example

The examples below illustrate which value the expression returns:

  • If you use the following input:

    parseDateTime('2022-04-30T22:00:00.000', 'yyyy-MM-dd''T''HH:mm:ss.SSS')

    the output is:

    Apr 30 2022 22:00:00

    The time will be 00:00, if it is not specified.

  • If you use the following input:

    parseDateTime('noDateTime', 'dd-MM-yyyy', dateTime(2007))

    the output is:

    Mon Jan 01 00:00:00 CET 2007

formatDateTime[UTC]

Converts the Date and time value to a string, formatted according to the format parameter. Without the format parameter, a standard format is used, which depends on the Java version and user locale. The function formatDateTime uses the users calendar and formatDateTimeUTC uses the UTC calendar.

Input Parameters

The input parameters are described in the table below:

ValueType
DateDate and time
Format (optional)String

Output

The output is described in the table below:

ValueType
A formatted representation of the Date and time value.String

Example

If you use the following input:

formatDateTime($object/Date1,'EEE, d MMM yyyy HH:mm:ss Z')

the output is:

'Sun, 8 Jun 2008 10:12:01 +0200'

To get a format like '2008-06-08T10:12:01', you need to concatenate two formatDateTime[UTC] functions:

formatDateTime($object/Date1,'yyyy-MM-dd') + 'T' + formatDateTime($object/Date1,'HH:mm:ss')

formatTime[UTC]

Converts the time part of Date and time value to a string in a standard format, which depends on the Java version and user locale. formatTime uses the users calendar and formatTimeUTC uses the UTC calendar.

Input Parameters

The input parameters are described in the table below:

ValueType
DateDate and time

Output

The output is described in the table below:

ValueType
A formatted representation of the time part of the Date and time value.String

Example

If you use the following input:

formatTime(dateTime(1974, 7, 2, 9, 50, 10))

the output is:

'9:50 AM'

formatDate[UTC]

Converts the date part of Date and time value to a string in a standard format, which depends on the Java version and user locale. formatDate uses the users calendar and formatDateUTC uses the UTC calendar.

Input Parameters

The input parameters are described in the table below:

ValueType
DateDate and time

Output

The output is described in the table below:

ValueType
A formatted representation of the date part of the Date and time value.String

Example

If you use the following input:

formatDate(dateTime(1974, 7, 2, 9, 50, 10))

the output is:

'7/2/74'

dateTimeToEpoch

Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT to the date.

Input Parameters

The input parameters are described in the table below:

ValueType
DateDate and time

Output

The output is described in the table below:

ValueType
The number of milliseconds since January 1, 1970, 00:00:00 GMT to the date.Integer/Long

Example

If you use the following input:

dateTimeToEpoch(dateTime(1974, 7, 2, 9, 50, 10))

The output is:

141990610000

epochToDateTime

Creates a Date and time that represents the specified number of milliseconds since January 1, 1970, 00:00:00 GMT.

Input Parameters

The input parameters are described in the table below:

ValueType
EpochInteger/Long

Output

The output is described in the table below:

ValueType
A Date and time that represents the specified number of milliseconds since January 1, 1970, 00:00:00 GMT.Date and time

Example

If you use the following input:

epochToDateTime(141990610000)

The output is:

dateTime(1974, 7, 2, 9, 50, 10)