0

Assuming two date-time value "2023-04-07T04:58:00.000Z" and "2023-04-07T17:58:00.000Z". This can have a day difference of 0 days in UTC timezone, however in some other timezone, lets say, CDT, there will be a difference of one day.

I want to calculate the number of days, depending on user's location, using Javascript Date, between two given dates.

Some cases to be considered:

  1. date 1 can be end date of a month, and date 2 can be start date of another month
  2. date 1 can be end date of year, and date 2 can be start date of another year.

I am looking for a function that will return me the number of days between two date, with time, in UTC, when executed on user's browser.

Uday Shankar
  • 438
  • 1
  • 3
  • 16
  • dear moderators, this question actually considers time as well, lest say the duretion is only for 10 minutes, but it can be a gap of one day for some timezone. I hope you guys can comprehend such situations. I tried to articulate my question to that detail, but still you guys marked my question as duplicate of some other question whichis just related to date (not considering time). Please unmark this as a duplicate – Uday Shankar Apr 21 '23 at 01:50
  • please let me know process of escalating the issue of baselessly marking my question as duplicate, you guys made my question un-answerable – Uday Shankar Apr 21 '23 at 01:53

0 Answers0