New Date('2016-10-31') Returning Sun Oct 30 2016
I'm in the Azores islands and yesterday (30 October 2016) the timezone has changed from GMT+0000 (AZOST) to GMT-0100 (AZOT). Now new Date('2016-10-31') is returning Sun Oct 30 2016
Solution 1:
From this documentation (emphasis mine):
Note: parsing of date strings with the Date constructor (and Date.parse, they are equivalent) is strongly discouraged due to browser differences and inconsistencies. Support for RFC 2822 format strings is by convention only. Support for ISO 8601 formats differs in that date-only strings (e.g. "1970-01-01") are treated as UTC, not local.
Post a Comment for "New Date('2016-10-31') Returning Sun Oct 30 2016"