How do I calculate the numbers of days between two dates

I am trying to archive files from one google drive folder to another based on the file creation date. I want the branch to execute if the file is older than 10 days.

The datehelper returns the difference in day numbers but not the actual days between the two dates.

for example the days between Oct 25, 2024 and Feb 28, 2025 gives a result of 3 days, and not the actual number of days.

Since I figured this out on my own, and think that it may help others. Here’s what worked for me.

export const code = async (inputs) => {
  const new_date= new Date(inputs.new_date);
  const new_date_ms=new_date.getTime();
  const diff_ms=(Date.now() - new_date_ms)/86400000;  
  return diff_ms;
};