Built-in Functions → Conversion Functions
The conversion functions convert values from one data type to another. Here are the supported functions:
Functions for returning an Integer
| Function | Signature | Description |
|---|---|---|
| int() | int(double exp) | Returns an int from a double |
| quarter() | quarter() | Returns an int corresponding to the quarter number of the current quarter |
| quarter() | quarter(date_timestamp exp) | Returns an int corresponding to the quarter number of the given date or timestamp |
| quarterDay() | quarterDay() | Returns an int corresponding to the count of days from the beginning of the quarter till the current date |
| quarterDay() | quarterDay(date_timestamp exp) | Returns an int to the count of days from the beginning of the quarter till a given date or timestamp |
| quarterMonth() | quarterMonth() | Returns an int corresponding to the month number of the quarter from the beginning of the quarter for the current date |
| quarterMonth() | quarterMonth(date_timestamp exp) | Returns an int corresponding to the month number of the quarter from the beginning of the quarter for a given date or timestamp |
| quarterWeek() | quarterWeek() | Returns an int corresponding to the week number of the quarter from the beginning of the quarter for the current date |
| quarterWeek() | quarterWeek(date_timestamp exp) | Returns an int corresponding to the week number of the quarter from the beginning of the quarter for a given date or timestamp |
| month() | month() | Returns an int corresponding to the month value of the current month |
| monthWeek() | monthWeek() | Returns an int corresponding to the week number of the current month |
| monthWeek() | monthWeek(date_timestamp exp) | Returns an int corresponding to the week number of the month for a given date or timestamp |
| weekDay() | weekDay() | Returns an int corresponding to the count of days from the beginning of the week till the current date |
| weeknum() | weeknum() | Returns an int corresponding to the week number of the current week for the current year |
| minute() | minute() | Returns an int corresponding to the minute value of the current time |
| hour() | hour() | Returns an int corresponding to the hour value of the current time |
| day() | day() | Returns an int corresponding to the day value of the current date |
| dayOfYear() | dayOfYear(date_timestamp exp) | Returns an int corresponding to the day number of the year for a given date or timestamp |
| year() | year() | Returns an int corresponding to the current year |
Functions for returning a Double
| Function | Syntax | Description |
|---|---|---|
| double() | double(string exp) | Returns a double from string |
| parseDouble() | parseDouble(string exp, string mask) | Returns double from a string |
| monthsBetween() | monthsBetween(date_timestamp startDate, date_timestamp endDate) | Returns a double corresponding to the number of months between two dates or timestamps |
Functions for returning a Long
| Function | Syntax | Description |
|---|---|---|
| long() | long(double exp) | Returns a long from a double |
| second() | second() | Returns the seconds component of the current time |
| second() | second(timestamp or date) | Returns the seconds component of a timestamp or date expression |
| epoch() | epoch(date_timestamp exp) | Returns the number of seconds since the epoch given a timestamp value |
Functions for returning a String
| Function | Syntax | Description |
|---|---|---|
| string() | string(int exp) | Returns a string from an int |
| toChar() | toChar(date exp, string format) | Returns a string from a date expression formatted with a string format |
| monthName() | monthName(date_timestamp exp) | Returns a string corresponding to the month name of a given date or timestamp. |
| monthName() | monthName() | Returns a string corresponding to the current month name. |
Functions for returning a Date or Timestamp
| Function | Syntax | Description |
|---|---|---|
| parseDate() | parseDate(string exp, string mask) | Returns date from a string using a specified format |
| parseTimestamp() | parseTimestamp(string exp, string mask) | Return a timestamp from a string with a given time and date format |
| timestamp() | timestamp(string exp) | Returns a timestamp from a string |
| quarterStartDate() | quarterStartDate(date_timestamp exp) | Returns a date corresponding to the first day of the quarter for a given date or timestamp |
| quarterEndDate() | quarterEndDate(date_timestamp exp) | Returns a date corresponding to the last day of the quarter for a given date or timestamp |
| monthStartDate() | quarterStartDate(date_timestamp exp) | Returns a date corresponding to the first day of the month for a given date or timestamp |
| monthEndDate() | monthEndDate(date_timestamp exp) | Returns a date corresponding to the last day of the month for a given date or timestamp |
| weekStartDate() | weekStartDate(date_timestamp exp) | Returns a date corresponding to the first day of the week for a given date or timestamp |
| weekEndDate() | weekEndDate(date_timestamp exp) | Returns a date corresponding to the last day of the week for a given date or timestamp |
Date inference logic
The Engine supports date and timestamp formats defined using the Unicode Locale Data Markup Language (LDML) to parse date and timestamp strings. For incomplete date strings—where some components are missing—the Engine applies the following default values:
- Year: current year
- Month: 1
- Day: 1
- Hour: 0 (12:00 AM)
- Minute: 0
- Second: 0
Important
If the provided format string implies or determines the value of a missing part (for example, DDDyyyy), the default value will not be applied.
- Before the 2025.7.3 release, such formats might fail to parse. Additionally, some time formats, including
hh(12-hour with AM/PM), were not handled correctly. - Starting the 2025.7.3,
- Missing date components are now correctly inferred from the provided fields.
- All supported time formats, including 12-hour (hh) and 24-hour (HH), are parsed correctly.
Examples:
parseDate("1452025", 'DDDyyyy')will be resolved to5/25/2025.parseTimestamp( "1202025 00:45 pm", 'DDyyyy h:m a')will be resolved to4/30/2025 12:45:00 PM.