> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Documentación sobre las funciones para trabajar con ULID

# Funciones para trabajar con ULID

<Note>
  La siguiente documentación se genera a partir de la tabla del sistema `system.functions`.
</Note>

{/*AUTOGENERATED_START*/}

<div id="ULIDStringToDateTime">
  ## ULIDStringToDateTime
</div>

Introducido en: v23.3.0

Esta función extrae el timestamp de un [ULID](https://github.com/ulid/spec).

**Sintaxis**

```sql theme={null}
ULIDStringToDateTime(ulid[, timezone])
```

**Argumentos**

* `ulid` — ULID de entrada. [`String`](/es/reference/data-types/string) o [`FixedString(26)`](/es/reference/data-types/fixedstring)
* `timezone` — Opcional. Nombre de la zona horaria del valor devuelto. [`String`](/es/reference/data-types/string)

**Valor devuelto**

Marca temporal con precisión de milisegundos. [`DateTime64(3)`](/es/reference/data-types/datetime64)

**Ejemplos**

**Ejemplo de uso**

```sql title=Query theme={null}
SELECT ULIDStringToDateTime('01GNB2S2FGN2P93QPXDNB4EN2R')
```

```response title=Response theme={null}
┌─ULIDStringToDateTime('01GNB2S2FGN2P93QPXDNB4EN2R')─┐
│                            2022-12-28 00:40:37.616 │
└────────────────────────────────────────────────────┘
```

<div id="generateULID">
  ## generateULID
</div>

Introducido en: v23.2.0

Genera un [Identificador Lexicográficamente Ordenable y Universalmente Único (ULID)](https://github.com/ulid/spec).

**Sintaxis**

```sql theme={null}
generateULID([x])
```

**Argumentos**

* `x` — Opcional. Una expresión que produce cualquiera de los tipos de datos admitidos. El valor resultante se descarta, pero la propia expresión se usa para evitar la [eliminación de subexpresiones comunes](/es/reference/functions/regular-functions/overview#common-subexpression-elimination) si la función se invoca varias veces en una consulta. [`Any`](/es/reference/data-types/index)

**Valor devuelto**

Devuelve un ULID. [`FixedString(26)`](/es/reference/data-types/fixedstring)

**Ejemplos**

**Ejemplo de uso**

```sql title=Query theme={null}
SELECT generateULID()
```

```response title=Response theme={null}
┌─generateULID()─────────────┐
│ 01GNB2S2FGN2P93QPXDNB4EN2R │
└────────────────────────────┘
```

**Ejemplo de uso cuando sea necesario generar varios valores en una fila**

```sql title=Query theme={null}
SELECT generateULID(1), generateULID(2)
```

```response title=Response theme={null}
┌─generateULID(1)────────────┬─generateULID(2)────────────┐
│ 01GNB2SGG4RHKVNT9ZGA4FFMNP │ 01GNB2SGG4V0HMQVH4VBVPSSRB │
└────────────────────────────┴────────────────────────────┘
```

<div id="see-also">
  ## Véase también
</div>

* [UUID](/es/reference/functions/regular-functions/uuid-functions)
