cancel
Showing results for 
Search instead for 
Did you mean: 

Adding mins to date&time field

former_member412802
Discoverer
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

mark_pe
Active Contributor
0 Kudos

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