Calculate date base on input date and minutes or hour difference

Hello Webmethods Expert,

I am trying to build a service which to scan all the transaction for the past 1 hour or 30 minutes until now.
Basically for this service i have 2 inputs:

  • start_date = last 1 hour or 30 minutes from now
  • end_date = current date time

For the “end_date”, i can use:
But i am still doubt, how can i construct “start_date” which is current datetime minus 1 hour or 30 minutes from now?

I don’t think the service can do this either.

Any idea on built in services to construct the “start_date”?

Appreciate any help.

Thank you,
Fanny T

1 Like


You should look into the “webMethods Integration Server Built-In Services Reference” manual.


WmPublic - Increments or decrements a date and time by a specified amount of time.

Happy coding.

1 Like

Hi Gerardo,

Looks like i am still referring to the Software AG built in Services Reference Version 9.5 SP1.
I don’t see the incrementDate in this document.

Since i am using Version 10.3, i can see this service in WmPublic.

Many thanks for pointing this service.

Best Regards,
Fanny T

There are a few steps to build a flow service which you may need, like below:

  1. build a service with
    service Input = minutes_offset
    service output = start_date, end_date

  2. invoke

  3. invoke, to get yyyy(year), MM(month), dd(day), HH(hour), mm(mins)

  4. invoke pub.math:addInts, add mm with minutes_offset (30mins or 60 mins)

  5. invoke to get end_date, pattern = yyyy-MM-dd HH:mm

  6. invoke to get start_date, pattern = yyyy-MM-dd HH:mm