UEL Builtin Functions

datetime functions

datetime.add

DateTime datetime.add(DateTime datetime, Int32 amount, String unit)

Returns the given date time with the specified amount of time unit added.

Parameters:

  • datetime - the input datetime (non-nullable).

  • amount - the amount of time to be added (non-nullable).

  • unit - the unit of the time to be added. time unit names can be {‘Day’, ‘Hour’, ‘Minute’, ‘Month’, ‘Quarter’, ‘Week’, ‘Year’} (non-nullable).

Returns:

updated date time.

datetime.component

Int32 datetime.component(DateTime datetime, String component)

Returns the specified component of the given date time.

Parameters:

  • datetime - the input datetime (non-nullable).

  • component - the component name. Component names can be {‘Day’, ‘Hour’, ‘Minute’, ‘Month’, ‘Quarter’, ‘Week’, ‘Year’} (non-nullable).

Returns:

date time component.

datetime.dayOfWeek

Int32 datetime.dayOfWeek(DateTime datetime)

Returns the ISO day of the week with 1 being Monday and 7 being Sunday.

Parameters:

  • datetime - the input datetime (non-nullable).

Returns:

day of week.

datetime.diffInSeconds

Int32 datetime.diffInSeconds(DateTime firstDatetimeValue, DateTime secondDatetimeValue)

Calculates secondDatetimeValue - firstDatetimeValue and returns the result expressed in seconds.

Parameters:

  • firstDatetimeValue - the first datetime value (non-nullable).

  • secondDatetimeValue - the second datetime value (non-nullable).

Returns:

difference in seconds.

datetime.fromString

DateTime datetime.fromString(String stringValue, String format)

Converts string to date time using the specified format.

Parameters:

  • stringValue - the datetime as string (non-nullable).

  • format - the datetime format (nullable).

Returns:

the date time converted using the specified format.

datetime.now

DateTime datetime.now()

Returns the current date time.

Parameters:

Returns:

current date time.

string functions

string.coalesce

<Primitive T> String string.coalesce(List(T) values)

Evaluates arguments and returns the value of the first argument that does not evaluate to NULL.

Parameters:

  • values - the input list (non-nullable, null elements not allowed).

Returns:

first non-null string.

string.concat

<Primitive T> String string.concat(List(T) values)

Returns a string that is the result of concatenation of the string representations of the input list elements.

Parameters:

  • values - the input list (non-nullable, null elements not allowed).

Returns:

the concatenated string.

string.lower

String string.lower(String string)

Returns the lowercase representation of the string.

Parameters:

  • string - the input string (non-nullable).

Returns:

the input string converted to lowercase.

string.ltrim

String string.ltrim(String string)

Returns the string after it removes leading spaces.

Parameters:

  • string - the input string (non-nullable).

Returns:

the input string without leading spaces.

string.rtrim

String string.rtrim(String string)

Returns the string after it removes trailing spaces.

Parameters:

  • string - the input string (non-nullable).

Returns:

the input string without trailing spaces.

string.substring

String string.substring(String string, Int32 startPosition, Int32 length)

Creates a substring from the input string.

Parameters:

  • string - the input string (non-nullable).

  • startPosition - the start position of the substring (non-nullable).

  • length - the length of the substring (non-nullable).

Returns:

the substring.

string.trim

String string.trim(String string)

Returns the string after it removes spaces from the start and end of the string.

Parameters:

  • string - the input string (non-nullable).

Returns:

the input string without leading or trailing spaces.

string.toInteger

Int32 string.toInteger(String string)

Converts the given string to integer.

Parameters:

  • string - the input string (non-nullable).

Returns:

the input string converted to integer.

string.upper

String string.upper(String string)

Returns the uppercase representation of the string.

Parameters:

  • string - the input string (non-nullable).

Returns:

the input string converted to uppercase.

Generic Type Classes

Integral

  • Int16

  • Int32

  • Int64

Numeric

  • Double

  • Int16

  • Int32

  • Int64

Primitive

  • Bool

  • Double

  • Int16

  • Int32

  • Int64

  • String

Temporal

  • DateTime