chiapa
chiapa

Reputation: 4412

Ignore UTC in javascript dates

I have got this:

startDate = new Date();
startDate = new Date(Date.parse('2014-10-20'));

finishDate = new Date();
finishDate = new Date(Date.parse('2014-11-21'));

You can see the GMT+0100 in the startDate and not in the finishDate, possibly because after 26 October the winter time is on.

I want to get those dates without regard to the timezone, winter or summer time.

Upvotes: 1

Views: 631

Answers (1)

Scimonster
Scimonster

Reputation: 33399

You could use Date#toUTCString(). This will return a string with the date in UTC timezone, which naturally will ignore daylight savings time.

Upvotes: 1

Related Questions