How to map with Format: Date

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 for available formats and PHP: List of Supported Timezones - Manual 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.

  • 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."

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

  • 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”.