It is a pain but from my perspective, I want it to be simple, after the all the user has set a date on his computer meaning his real date and the date he entered are of the same timezone.
For simplicity, what I think happens is that because of the timezone, instead of calculating, for example: 1970-01-01 00:00:00 (epoch) to 1970-01-02 00:00:00 (user input), the second date is translated into timezone date, meaning 1970-01-01 21:00:00 (3 hours back) and because of that, the days since epoch = 0 instead of 1.
So basically, I want to calculate 1970-01-01 00:00:00 to 1970-01-02 00:00:00 with both GMT timezone (to cause no change because of the time).
I think that I did that with my code for the second date (see above code) but I either did it wrong or I should do the same to the epoch date, so Instead of just new Date(1970, 0, 1) I should do it also in GMT.
What do you think? The real problem is that I’m GMT+X so it’s working fine as it is now, and changing to GMT-X showed my fix was correct but maybe it’s because the problem is only inside the time frame of the timezone (GMT-5 so the problem happens between midnight and 5am). Again, just a guess.