> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-user-guide.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Import Datetime Attributes

# Introduction

In this article, you will learn how to import datetime attributes from your [Data Warehouses](/user-guide/data/imports/data-warehouses-imports) into MoEngage correctly. This will help you build your segmentation queries accurately, resulting in more personalized targeting and analytics.

# Step 1: Prepare Your Data

Refer to [this document](/user-guide/data/imports/overview/overview-imports) for information on preparing your data according to the expected formats of MoEngage. [This section](/user-guide/data/imports/overview/overview-imports) provides the full list of supported datetime formats.

# Step 2: Upload a Sample File

For your attribute(s) to be correctly imported as datetime, you must inform MoEngage of the Allowed Datetime types for these attributes. Begin with creating a sample .csv file that contains the following columns:

Table

| Column Name        | Value                                                                |
| ------------------ | -------------------------------------------------------------------- |
| `id`               | A sample User ID.  Ensure that you provide a unique user identifier. |
| `<attribute_name>` | A sample value of your attribute.                                    |
| `<attribute_name>` | A sample value of your attribute.                                    |

<Info>
  Add a new column for each of your datetime attributes. A single row with a dummy User ID is sufficient.
</Info>

## Example Use Case

In this example, we will import the following attributes of type datetime:

* `my_birthday` with the format `YYYY-MM-DD`
* `my_order_time` with the format `YYYY-MM-DD hh:mm:ss`
* `my_user_creation_time` with the format `YYYY-MM-DDThh:mm:ssTZD`

You can [download](https://dashboard-static-assets.s3.amazonaws.com/partners-integration-ui/app-marketplace-public/helpdoc/Import-Datetime-Attr-Example.csv) the sample file for this example to follow along.

# Step 3: Upload the Sample File

After you have a sample file ready with all your datetime attributes and their expected formats:

1. On the sidebar menu in MoEngage, hover over the **Segment** menu item <img style={{ display:"inline-block" }} src="https://mintcdn.com/moengage-user-guide/KDTKwCXFq0OhxrjH/images/icon.png?fit=max&auto=format&n=KDTKwCXFq0OhxrjH&q=85&s=bf7630c25ceed7fc1b0cfe8ace994192" width="74" height="70" data-path="images/icon.png" />. The **Segment** menu appears.
2. Click **User Imports**.
   <Frame>
     <img src="https://mintcdn.com/moengage-user-guide/KDTKwCXFq0OhxrjH/images/userimportsnw.png?fit=max&auto=format&n=KDTKwCXFq0OhxrjH&q=85&s=7013916904742f8df33566d377a718a1" alt="Userimportsnw" width="458" height="842" data-path="images/userimportsnw.png" />
   </Frame>
3. On the User imports page, click **Import users**.
4. In the **Import name** box, type an identifiable name for your import.
5. Under **Select user** type, select **Registered users**.
6. Select your sample file. Click **Preview file** to see if we correctly read all your data. <img src="https://mintcdn.com/moengage-user-guide/zi8OFpJJZ8wcpIWO/images/moengage_2a3c47.png?fit=max&auto=format&n=zi8OFpJJZ8wcpIWO&q=85&s=6b19e63a5ae982af7d2cdd22fb582d22" width="2880" height="2038" data-path="images/moengage_2a3c47.png" />
7. Click **Next** to proceed to the mapping.
8. Mark the first column as your User identifier.
9. For each of your datetime attributes, click **+ Create new** **attribute** from the list to add it as a new attribute in MoEngage. <img src="https://mintcdn.com/moengage-user-guide/DfjER0fx7ZrT4EDG/images/moengage_e0c697.png?fit=max&auto=format&n=DfjER0fx7ZrT4EDG&q=85&s=b3003665603f680e2c8d69a6e97e6576" width="1676" height="750" data-path="images/moengage_e0c697.png" />
10. In the **Data type** list, select **Date time** and in the **Date time format** list, select the correct datetime format. We will attempt to auto-capture these for you. <img src="https://mintcdn.com/moengage-user-guide/Kch8a9R_vRsrkgut/images/moengage_70b66b.png?fit=max&auto=format&n=Kch8a9R_vRsrkgut&q=85&s=ae1fbfba7b572a64c811424b3d747efc" width="1212" height="724" data-path="images/moengage_70b66b.png" />
11. After you have created all your attributes and marked their types, you are ready to import these. <img src="https://mintcdn.com/moengage-user-guide/lhXvdjtPtl1U-hcS/images/moengage_95b668.png?fit=max&auto=format&n=lhXvdjtPtl1U-hcS&q=85&s=a0ba381862b6d011f9f781222ce07b67" width="2880" height="2500" data-path="images/moengage_95b668.png" />
12. Click **Next** to proceed.
13. Select the import frequency as **As soon as possible** and schedule the import.
14. We will upload the file and attempt to import it.

# Step 4: Pin the Data Types of These Attributes

<Info>
  Only Admins of your accounts can execute actions like changing status, visibility, allowed data types, readable names, and descriptions.
</Info>

After your import is complete:.

1. On the left navigation menu in the MoEngage dashboard, click **Segments** and then click [Data Management](/user-guide/settings/data-management/overview-data-management).
2. Perform the steps in this [document](/user-guide/settings/data-management/overview-data-management) to set allowed data types for these newly created attributes.
3. Ensure that you select **datetime** for each of the attributes. You need to perform these for both User Attributes and Event Attributes.
4. After you pinned the correct data types for each attribute, they will be correctly ingested as datetime into MoEngage.

# Step 5: Import Your Data

You are now ready to import your data into MoEngage. Ensure that you map the newly created attributes to their respective columns.
