Start integrating with ONEiO for free!
SIGN UP

How to use date formatter

Date formatter is used to change the message date and/or time to another format required by the target system. 

Using the date formatter in a routing rule 

1. Edit or create a new routing rule.

2. Go to Mappings > Outbound mappings > Add single mapping > Click "Add" and select "Date" from the dropdown menu. 
Test_formatter_2.PNG

The date formatter changes the date format for a given date string. If an attribute is marked as the date in ONEiO's internal schema for some system, then the date string is always already in ISO 8601 format. Otherwise, the date string could be taken from some other field, for example with a Regular expression formatter and it could be in some other date format.

  • fromFormat specifies initial format of the date. Should be valid date format. The default date format is ISO 8601.
  • fromTimeZone specifies the timezone that the given date is in. If not present, defaults to UTC
  • toFormat specifies destination format of the date. Also, should be a valid date format and is required.
  • toTimeZone specified the timezone that the destination attribute should be in. If not present, defaults to UTC.

Symbols

You can add relevant information to the date format by using symbols. For example, the time zone offset or the day of the week.

A list of symbols that can be used in date formatter can be found here.

Testing date formatter

You can test the date formatter by clicking "Test" and providing a test string.

Changing date format

You can change the date format for example from mm/dd/yyyy to dd/mm/yyyy and see how it works in a test formatter. 

Test_Formatter_1.PNG

Changing time based on time zones

Select the source time zone and the target time zone and the time will be converted to target time zone's time.
Test_Formatter_3.PNG

Links to more information about date formats:

https://www.w3.org/TR/NOTE-datetime 

https://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.