How to format and subtract date (in days)

Hi Guys,

Need help, how do I get the numbers of day/s base on the current date.
The current date is should be defined in the code.

currentDate = "2021-02-02T06:00:00.210Z"

[
   {
      "dueDate": "'2021-02-10T06:25:49.210Z'",
   },
  {
      "dueDate": "'2021-02-11T06:25:49.210Z'",
   }
]

Expected Output:

[
   {
      "dueDate": "'2021-02-10T06:25:49.210Z'",
      "noOfDays": 8
   },
  {
      "dueDate": "'2021-02-11T06:25:49.210Z'",
      "noOfDays": 9
   }
]

Thanks.

select 
DATE_DIFF_STR("2021-02-10T06:25:49.210Z", "2021-02-02T06:00:00.210Z", "day");
1 Like

Hi @vsr1,

Cool thanks man.