# How to map with Format: Date

**URL:** <https://forum.alumio.com/t/how-to-map-with-format-date/380>\
**Category:** Transformers\
**Tags:** mappers, data-transformer\
**Created:** [January 11, 2023, 4:06pm UTC](https://forum.alumio.com/t/how-to-map-with-format-date/380 "2023-01-11T16:06:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![r.candrian](https://forum.alumio.com/user_avatar/forum.alumio.com/r.candrian/32/235_2.png) [@r.candrian](https://forum.alumio.com/u/r.candrian)\
**Post date:** [January 11, 2023, 4:06pm UTC](https://forum.alumio.com/t/how-to-map-with-format-date/380/1 "2023-01-11T16:06:56Z")

</div>

## Introduction

The Format: Date Mapper allows users to map dates in any format that the PHP datetime supports. This way, it is possible to map the date, i.e., 021822 to 18-02-2022. Apart from that, it is also possible to map the datetime value by input, such as tomorrow or -3 days.

Please refer to [PHP: Supported Date and Time Formats - Manual](https://www.php.net/manual/datetime.formats.php) for available formats and [PHP: List of Supported Timezones - Manual](https://www.php.net/manual/timezones.php) for available time zones.

In this guide, we will provide a sample of how you can use this mapper.

### Format a value as a date

1. Add a new value mapper.
2. Configure the accessor to access the attribute for the value that you want to map.
3. Add a new mapper and choose Format: Date.
4. Here you will get some fields to fill in.

 ![](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/1X/9a28b5d1435752d6881e13d64d1ffd38de2123e6.png)

- Output format (required). The output datetime format of the mapping.
- Input format. The date instance will be created based on the datetime format of the input value.
- Output timezone. The output datetime time zone of the mapping.
- Input timezone. The date instance will be created based on the datetime time zone of the input value.

### Create new date

1. Create a new value setter.
2. Fill in the name of the new **Key**.
3. Choose a string as a config value, then you can leave the Value field blank if you want to get the **current date time** , or you can **modify the Value field as needed** , e.g., “-3 days."

 ![](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/1X/2bfe7fbc3a4ec8c57843960c443cc891ef0daa3d.png)

1. Create a new mapper and select Format: Date
2. Here you will get some fields to fill in.

 ![](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/1X/9a28b5d1435752d6881e13d64d1ffd38de2123e6.png)

- Output format (required). The output datetime format of the mapping.
- Output timezone. The output datetime time zone of the mapping.

### Modify date, add substract time

As mentioned in step 3 of ‘Create new date’ you can modify your date by  
appending “+1 week” or “+3 days” for example.  
Or by making the input factual such as “Monday next week”.  
With “[Relative Formats](https://www.php.net/manual/en/datetime.formats.relative.php)”.

 ![image](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/1X/1c32b0ab31f7ac9f0943b718930adbc3f61c3b5e.png)
