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

# Dates and times strategy

Avro files written to this destination can store date, time, and timestamp values in one of two ways, depending on the setting you choose in the **Dates and times strategy** property when you [create a Streaming pipeline](https://docs.maia.ai/docs/streaming/streaming-pipelines.md#create-a-streaming-pipeline):

* **Native Types:** This adds Avro logical types to the schema, so that the pre-built pipelines can recognise, date, time, and timestamp columns and load them as the matching types. New pipelines use this by default.
* **Integers from Epoch:** This adds no logical types, so date, time, and timestamp columns appear as plain integers in the destination after processing by the pre-built pipelines.

Both strategies write the same value column, but **Native Types** also adds the logical type to the schema.

> [!NOTE]
>
> If your streaming destination is Snowflake, read [Streaming to a Snowflake destination](https://docs.maia.ai/docs/streaming/snowflake-streaming-destination.md#dates-and-times-strategy) for details.

Changing this property for an already existing pipeline may result in the schema changing and new columns being added to your destination tables.

The following table shows how different source time types are written to the Avro file when using **Integers from Epoch**, and the column type that results when the data is loaded into each cloud data warehouse using the Matillion pre-built pipelines with **Native Types**.

| Source type | Integers from epoch | Cast to Snowflake types | Cast to Redshift types | Cast to Databricks types | Cast to BigQuery types |
| - | - | - | - | - | - |
| date | Integer, number of days since epoch | `DATE` | `DATE` | `DATE` | `DATE` |
| timestamp (up to 3 decimal places) | Integer, number of milliseconds since epoch | `TIMESTAMP_NTZ(9)` | `TIMESTAMP` | `TIMESTAMP` | `TIMESTAMP` |
| timestamp (4-6 decimal places) | Integer, number of microseconds since epoch | `TIMESTAMP_NTZ(9)` | `TIMESTAMP` | `TIMESTAMP` | Integer, number of microseconds since epoch (`INT64`) |
| timestamp (7-9 decimal places) | Integer, number of nanoseconds since epoch | `TIMESTAMP_NTZ(9)` | `TIMESTAMP` (truncated to microseconds) | `TIMESTAMP` (truncated to microseconds) | Integer, number of nanoseconds since epoch (`INT64`) |
| timestamp with time zone | String, ISO formatted, often forced into GMT | `TIMESTAMP_TZ(9)`, often forced into GMT | `TIMESTAMP` | `TIMESTAMP` | String (`STRING`), ISO formatted, often forced into GMT |
| time (up to 3 decimal places) | Integer, number of milliseconds past midnight | `TIME(9)` | `TIME` | Integer, number of milliseconds past midnight | `TIME` |
| time (4-6 decimal places) | Integer, number of microseconds past midnight | `TIME(9)` | `TIME` | Integer, number of microseconds past midnight | Integer, number of microseconds past midnight (`INT64`) |
| time (7-9 decimal places) | Integer, number of nanoseconds past midnight | `TIME(9)` | `TIME` (truncated to microseconds) | Integer, number of nanoseconds past midnight | Integer, number of nanoseconds past midnight (`INT64`) |
| time with time zone | String, ISO formatted, often forced into GMT | String, ISO formatted, often forced into GMT | String, ISO formatted, often forced into GMT | String, ISO formatted, often forced into GMT | String (`STRING`), ISO formatted, often forced into GMT |

> [!NOTE]
>
> The epoch integer value is the number of *days* since the Unix epoch for all data sources except Oracle, where it is the number of *milliseconds* since the Unix epoch.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.