Comparing a date value with today's date, when using different date formats

Document created by dan_heichel489496 Employee on Apr 5, 2018
Version 1Show Document
  • View in full screen mode

When comparing Dates of different formats, checking whether they are Equal to each other becomes a challenge.  (For instance, comparing a document date that arrived in format dd/mm/yyyy to the Current Date, which will use the standard Boomi date format of yyyyMMdd HHmmss.SSS.)

 

To use a pair of sample values, 01/04/2018 can correctly be judged as greater than 20180329 123012.345.  However, it cannot be correctly judged as equal: even if they're meant to represent the same point in time, 01/04/2018 will never be equal to 20180401 123012.345.

 

Even if you use a date mask to reformat the document value, the same problem exists.  20180401 000000.000 is not equal to 20180401 123012.345.

 

There are two possible solutions to this.

 

1. Make sure the incoming date value already uses the same format as Boomi.  This might require adjustment to your back-end system, and is thus not often possible.

 

2. An easier way is to resolve this is to:

a. Use Relative Date instead of Current Date in your comparison, and set it to -1 days. This will generate a value equal to yesterday's date.

b. Then, change your comparison operator from "Equals" to "Greater Than". This will now check whether your incoming date is later than yesterday.

 

Useful references:

Standard Boomi date format:

Date/Time datatype 

 

Date parameter options, including Relative Date:

Parameter valuetypes 

Attachments

    Outcomes