AnsweredAssumed Answered

Date difference javascript in pam workflow

Question asked by ss_shubha on Mar 1, 2016
Latest reply on Mar 3, 2016 by camja06



In one of my post condition I want to calculate date difference between today and selected day.


I executed following code in js editor and it works


var date1 = new Date("Feb 15, 2016 9:07:20 AM");
var date2 = new Date("Mar 1, 2016 3:58:34 PM");
var diffDays = parseInt((date2 - date1) / (1000 * 60 * 60 * 24));

alert(diffDays );


If this code written in post execution code its giving me 0 as result.

I have defined process dataset of datatype "date" to store the date value which come from DB.

Then too its not working can anyone help on this