Conversion

toDateTime

Parses a string that contains a date and converts the result into a DateTime.

Usage

<string>.toDateTime(<format>)

Parameters

NameTypeRequiredDescription
formatstringNoThe format of the resulting string.

Returns

A DateTime, set to the date from the parsed string.

Examples

ExpressionResult
"2021-01-01T05:06:07".toDateTime()01 Jan 2001, 05:06:07
"Mon, 15 Sep 2008 09:30:41 GMT".toDateTime()15 Sept 2008 09:30:41
"05/01/2009 01:30:42 PM".toDateTime("MM/dd/yyyy hh:mm:ss tt")05 Jan 2009, 13:30:42

toInteger

Converts a string that contains an integer into an integer.

Usage

<string>.toInteger()

Returns

An integer.

Examples

ExpressionResult
"44".toInteger()44

toNumber

Converts a string that contains a number into a number.

Usage

<string>.toNumber()

Returns

A number.

Examples

ExpressionResult
"44".toNumber()44
"44.5".toNumber()44.5
"-44.5".toNumber()-44.5

toString

Converts a value into a string. This function is compatible with any existing data type.

Usage

<value>.toString(<format>)

Parameters

NameTypeRequiredDescription
formatstringNoThe format of the resulting string. This parameter is only used for Number and DateTime values.

Returns

A string representation of the original value.

Examples

ExpressionResult
44.toString()"44"
44.5.toString()"44.5"
44.56.toString("F1")"44.6"
"abcd".toString()"abcd"
true.toString()"true"
newDateTime(2, 5, 2021, 12, 30, 23 ).toString()"2021-05-02T12:30:23.000Z"
newDateTime(2, 5, 2021, 12, 30, 23 ).toString("dddd dd MMMM")"Sunday 02 May"