I have a requirement where I have to determine the difference in time when a particular workflow was last Run and current time (in minutes).
I query xtk:workflow schema in a JS activity in a workflow with "where" condition with the workflows Internal name and the fetch its @lastModifiedDate. However, when try to find the difference between the current date and lastModified date ( currentDate - lastModifiedDate) it gives NaN error. I tried converting the dates into milliseconds using parse() method. In this case current date gets converted to milliseconds but lastModifiedDate does not and returns NaN. I also tried converting lastModifiedDate into string, generate a date using the string [ var lastDate = new Date(lastModifiedDateString)] and then parse it , but I get same NaN from lastModifiedDate but current date works fine. The string generated for lastModified is perfectly ok.
Please suggest how to get the time difference, in Javascript activity, between the last time the wkf had run and current time. (if possible in minutes)
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi,
Use NL.XTK.parseDateTime().
Thanks,
-Jon
I think so you need to use the Time functionality instead of currentDate and last Modified date.
It might be both the currentDate and ModifiedDate are same i.e. of today because of which you might be receiving an error.
Views
Replies
Total Likes
Hi @bhaskarc1289447,
Were you able to resolve this query with any of the given solutions or do you still need more help here? Do let us know.
Thanks!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies