> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peaka.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Teradata functions

These functions provide compatibility with Teradata SQL.

## String functions

### char2hexint

```
char2hexint(string) -> varchar
```

Returns the hexadecimal representation of the UTF-16BE encoding of the string.

### index

```
index(string, substring) -> bigint
```

Alias for [strpos()](/sql/functions/string#strpos) function.

## Date functions

The functions in this section use a format string that is compatible with
the Teradata datetime functions. The following table, based on the
Teradata reference manual, describes the supported format specifiers:

| Specifier     | Description                        |
| ------------- | ---------------------------------- |
| `- / , . ; :` | Punctuation characters are ignored |
| `dd`          | Day of month (1-31)                |
| `hh`          | Hour of day (1-12)                 |
| `hh24`        | Hour of the day (0-23)             |
| `mi`          | Minute (0-59)                      |
| `mm`          | Month (01-12)                      |
| `ss`          | Second (0-59)                      |
| `yyyy`        | 4-digit year                       |
| `yy`          | 2-digit year                       |

<Warning>
  Case insensitivity is not currently supported. All specifiers must be lowercase.
</Warning>

### to\_char

```
to_char(timestamp, format) -> varchar
```

Formats `timestamp` as a string using `format`.

### to\_timestamp

```
to_timestamp(string, format) -> timestamp
```

Parses `string` into a `TIMESTAMP` using `format`.

### to\_date

```
to_date(string, format) -> date
```

Parses `string` into a `DATE` using `format`.
