# Use a date field in the import mapping

If you have an import in Channable that contains a field with a date in it, map it to a 'Date & Time' field type so that you can use special ['Date' rules](https://channable-test.gitbook.io/channable-test-docs/manage-improve-product-data/rules-bulk-edit-and-enrich/how-to-use-conditions-if-in-rules/rule-conditions-dates) to filter based on this date.

Follow these steps to map your field to the 'Date & Time' type:

{% stepper %}
{% step %}

### Map the field

Go to **Setup > Imports > \[Added import] > Edit mapping.** Locate your internal field with the date in it.
{% endstep %}

{% step %}

### Edit the field

Click on the **Edit** button for that field.
{% endstep %}

{% step %}

### Set type to Date & Time

In the pop up, at the **Type** field, select 'Date & Time'.
{% endstep %}

{% step %}

### Save and import

Click on **Save and import.** There will be a new **Custom date format** dropdown next to the **Edit** field.
{% endstep %}

{% step %}

### Choose or specify date format

Click on the **Custom date format** dropdown. Choose a default date format, or choose to specify a custom date format.
{% endstep %}
{% endstepper %}

<figure><img src="https://3042294697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZa0iYflHeXmKWGnfFMAN%2Fuploads%2FPsq2BoaSR4qI49OIMexa%2F13438440078994?alt=media&#x26;token=f127d89c-89ec-42c6-a838-a435d156b550" alt=""><figcaption></figcaption></figure>

#### Date formats <a href="#h_01j29386ja26ew163yjc1wqj1d" id="h_01j29386ja26ew163yjc1wqj1d"></a>

| **Date in your import**                                     | **Date format to choose in Channable** |
| ----------------------------------------------------------- | -------------------------------------- |
| 2017-10-19T15:03:23                                         | ISO 8601                               |
| <p>2017-10-19T15:03:23Z</p><p>2017-10-19T15:03:23+02:00</p> | ISO 8601 TZ                            |
| Thu, 19 Oct 2017 15:03:23 +0200                             | RFC 2822                               |
| 2017-10-19                                                  | Year-month-day                         |
| 19-10-2017                                                  | Day-month-year                         |
| 10-19-2017                                                  | Month-day-year                         |

or use a custom format:&#x20;

#### Custom formats <a href="#id-01k60pabm1qqefy9ccvenktck5" id="id-01k60pabm1qqefy9ccvenktck5"></a>

Custom formats specify the format of a date.

| **Date in your import** | **Custom date**   |
| ----------------------- | ----------------- |
| 25-07-2017 11:53        | %d-%m-%Y %H:%M    |
| 25-07-2017 11:53:39     | %d-%m-%Y %H:%M:%S |
| 25-07-2015T11:53        | %d-%m-%YT%H:%M    |

The date format is defined by a string containing two types of characters:

* Static text: Characters that appear literally in the output (e.g., /, -, space)
* Specifiers: Variable date parts that start with a percentage symbol (e.g., %m for the month number)

{% hint style="info" %}
**Note:** Format specifiers expect numbers to have their full format (i.e. 05 instead of 5) by default. To use the shortened version, use %- followed by the specifier (e.g. %-d).
{% endhint %}

| **Format specifiers** | **Description**                                                                                                     |
| --------------------- | ------------------------------------------------------------------------------------------------------------------- |
| %Y                    | The year                                                                                                            |
| %y                    | The year of the century, so two digits                                                                              |
| %m                    | The month of the year (as a number)                                                                                 |
| %B                    | The name of the month of the year (January, February, etc.)                                                         |
| %b                    | The short name of the month year (Jan, Feb, etc.)                                                                   |
| %V                    | The week of the year (as a number 1-53)                                                                             |
| %d                    | The day of the month                                                                                                |
| %A                    | The name of the day of the week (Monday, Tuesday, etc.)                                                             |
| %a                    | The short name of the day of the week (Mon, Tue, etc.)                                                              |
| %p                    | The day-half of the day (so AM or PM)                                                                               |
| %H                    | The hour of the day (so from 0 to 23, inclusive)                                                                    |
| %I                    | The hour of the day-half (so from 1 to 12, inclusive)                                                               |
| %M                    | The minute of the hour                                                                                              |
| %S                    | The second of the minute                                                                                            |
| %Q                    | Optional period and fraction part of the second. To specify fractional seconds, combine this with %S, i.e. use %S%Q |
| %z                    | Timezone offset in the format ±HHMM                                                                                 |
| %Z                    | Timezone name, or offset in the format ±HHMM                                                                        |

{% hint style="success" %}
**Tip:** To use a % in a string, use %%.&#x20;
{% endhint %}
