# toDateTime(epoch)

Converts an epoch day to a `DateTime` type.

:::note
You can only use this function when the time zone feature is enabled. If the time zone feature is disabled, use the [toDate()](/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-todate.md) function.
:::

```nolang
q = foreach q generate toDateTime(epoch) as "DateTime";
```

The *format* argument isn’t valid for converting *epoch* numerical values. It’s only valid for converting date string values.
