UEL Builtin Functions

datetime functions

datetime.add

<Integral T> DateTime datetime.add(DateTime datetime, T 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

Int64 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.fromComponents

<Integral T> DateTime datetime.fromComponents(T year, T month, T day)

Constructs a date time from components.

Parameters:

  • year - the year value (non-nullable).

  • month - the month value (nullable).

  • day - the day value (nullable).

Returns:

the date time constructed from components.

datetime.now

DateTime datetime.now()

Returns the current date time.

Parameters:

Returns:

current date time.

number functions

number.log

<Numeric T, Numeric R> Double number.log(T value, R base)

Returns logarithm of the value to the base if the base is specified, else returns the natural logarithm of the value.

Parameters:

  • value - the value (non-nullable).

  • base - the base (nullable).

Returns:

the logarithm of the value to the base if the base is specified, else the natural logarithm of the value.

number.power

<Numeric T, Numeric R> Double number.power(T base, R exponent)

Returns the base raised to the exponent power.

Parameters:

  • base - the base (non-nullable).

  • exponent - the exponent (non-nullable).

Returns:

the base raised to the exponent power.

number.toString

<Numeric T> String number.toString(T value)

Converts the numeric value to string.

Parameters:

  • value - the value (non-nullable).

Returns:

the value converted to string.

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.contains

Bool string.contains(String string, String substring)

Returns true if the string contains the substring, false otherwise.

Parameters:

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

  • substring - the substring (non-nullable).

Returns:

true if the string contains the substring, false otherwise.

string.endswith

Bool string.endswith(String string, String substring)

Returns true if the string ends with the substring, false otherwise.

Parameters:

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

  • substring - the substring (non-nullable).

Returns:

true if the string ends with the substring, false otherwise.

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.startswith

Bool string.startswith(String string, String substring)

Returns true if the string starts with the substring, false otherwise.

Parameters:

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

  • substring - the substring (non-nullable).

Returns:

true if the string starts with the substring, false otherwise.

string.substring

<Integral T> String string.substring(String string, T startPosition, T 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

Int64 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