Eli
You need to convert your date to milliseconds.
const start = new Date("1/1/2020"),
now = Date.now(),
diff = now - start.getTime(),
diffDays = diff / 86400000;
------------------------------
Rex Kenley Tan, MCSA, MCSD
Tallmadge OH
https://www.youracclaim.com/users/rex-kenley-tan*Always be CURRENT with JavaScript & C#, NEVER be obsolete.
DISCLAIMER: All views expressed on this site are my own and DO NOT represent the opinions of ANY entity whatsoever with which I have been, am now, or will be affiliated.
------------------------------
Original Message:
Sent: Jan 31, 2020 08:56 AM
From: Eli Rodriguez
Subject: Calculating DiffinDays with a Date Only Field
I have "Field A" with Date Only type, I want to calculate the number of days between that date and NOW(); unfortunately NOW() qualifies as Date and Time data. So the calculated field will bounce back with an error. Looking for ideas on how to tackle this.
------------------------------
Eli Rodriguez
Systems Engineer
WI
------------------------------