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 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

Date formatter changes date format for given date string. If an attribute is marked as 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. If not present, 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.

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

Testing date formatter

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

Changing date format

You can change date format for example from mm/dd/yyyy to dd/mm/yyyy and see how it works in 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.