Calculate date difference

Anyone know the best way to calculate the difference between 2 dates? The PSUtilities.date:calculateDateDifference service gives incorrect results around April 4, 2004 so I can’t use it.
Thanks!

Bonnie,

Please let me know for which date inputs, that particular service is’nt working.

Thanks,

Pauly

The problems start around April 4, 2004. For example the difference between April 2 and April 3 comes back as 1 day, but the difference between April 2 and April 5 comes back as 2 days instead of 3.
We created a custom SQL select (select dateDiff (day ,?,?)) to calculate the difference.

Hi ,
I am totally new here in webMethods and trying to use the calculateDateDifference built in service but getting the below error. can someone please let me know the correct start and end date pa tern for this service.
Could not run ‘inbuilt’
com.wm.app.b2b.server.ServiceException: [ISS.0086.9249] Missing Parameter: startDatePattern

Server error occurred
Launch completed: 2019-01-28 06:29:23.574
Launch started: 2019-01-28 07:14:51.737
Configuration name: inbuilt
Configuration location: U:/MyWorkSpace/.metadata/.plugins/org.eclipse.debug.core/.launches/inbuilt.launch

Could not run ‘inbuilt’
com.wm.app.b2b.server.ServiceException: [ISS.0086.9249] Missing Parameter: startDatePattern

Server error occurred
Launch completed: 2019-01-28 07:15:04.096

Hi Aryan,

depending on what your source and target date is formatted like you will have to apply the appropriate date.

The Syntax of the pattern follows the underlying java.util.date-Classes available in the Java API.
See Details in the IS Built-In-Services Reference.

Regards,
Holger

1 Like

Hi Aryan ,

As the error clearly telling startDatePattern is missing. For this service you need to pass 4 parameter .

Hi Aryan,

If your start date is 01/01/2019, pattern should be like MM/dd/yyyy
Similarly end date and its pattern.

Regards,
Sreekanth