Using DateUtils method


1. To use this method, please place the attached class file in customClasses folder:
C:\Program Files\AdeptiaSuite\AdeptiaServer-5.1\ServerKernel\customClasses

customClasses is under the ServerKernel folder.

>>>> Place the attached file into this folder with name as "DateUtils.class"

2. Restart the Adeptia kernel and webrunner

3. Now open the Mapper and in the bottom right menu under GlobalMethods you will see DateUtils() method.

4. Now select the Target element and double click on this method and you can now use it in the Textual Rules mode.

There are 9 arguments need to be pass in this function.

o Input Date
o Input Date Format
o Output Date Format
o Year need be added/subtracted
o Month needs to be added/subtracted
o Day needs to be added/subtracted
o Hour needs to be added/subtracted
o Minutes need to be added/subtracted
o Seconds need to be added/subtracted

Example to increment Date by one day:
java:DateUtils.DateAdd($TextFileSchema/Root/Record/MyDate, 'yyyy-MM-dd', 'yyyyMMdd', '0' , '0', '1', '0', '0', '0')

Note: To add or subtract the hour. minutes or seconds the input date must have the timestamp as part of its value.

Have more questions? Submit a request


  • 0
    David Paras

    When using negative values (subtracting) and the Saxon XSL Transformer, you'll need to follow the steps in the Saxon XSL Transformer guide


    Otherwise you'll receive an error similar to the one below

    Error: Required item type of 6th argument of saxonJavaMapperUtilityClass:dateAdd() is xs:integer; supplied value has item type xs:double

Article is closed for comments.