Forum Discussion

kumar25's avatar
kumar25
New Contributor II
2 years ago
Solved

Difference between 2 dates

Hi, I have 2 dates, which are of localdatetime. Date1 - 2023-08-13T14:17:00.000 Date2 - 2023-08-23T05:00:00.000 I am using the below expression find the difference between them, and i am getting ...
  • koryknick's avatar
    2 years ago

    kumar25 - This will first strip off the portion of your string that contains the timestamp, then perform the date difference, and finally convert from milliseconds to day.

    (Date.parse($Date2.substr(0,10)) - Date.parse($Date1.substr(0,10)))
    / (1000 * 3600 * 24)

     Hope this helps!