Skip to Content
avatar image
Former Member

Adding mins to date&time field

Hi All,

Iam working on Agentry, WM6.3 and i need to have a solution where certain minutes(a constant) need to be added to the current timestamp (date and time together).

I have added a Date & Time property in the transaction and added a rule which calls a JavaScript to add the mins to current timestamp, but the javascript always returns 0.

function convert(str) {

var currentDate = new Date();

return currentDate.setTime(currentDate.getTime() + str*60*1000); }

Can anyone suggest any other ways to achieve this.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 07, 2017 at 02:38 PM

    Komal,

    You may check this Wiki but this example is subtracting versus adding so you may just change it accordingly. It's all tied to epoch date.

    https://wiki.scn.sap.com/wiki/display/SAPMOB/Subtract+two+dates+using+a+rule+to+determine+difference

    Best Regards,

    Mark Pe
    SAP Product Support

    Add comment
    10|10000 characters needed characters exceeded