Does the Date object in Javascript ever use a non-Gregorian calendar?
The MDN and MSDN docs outline the methods on the Date object and reference UTC and IETF-compliant RFC 2822 timestamps.
The Wikipedia article mentions
Days are conventionally identified using the Gregorian calendar, but Julian day numbers can also be used.
The MDN and MSDN documentation just says that the non-UTC methods refer to the "local time", but doesn’t define what "local time" is.
I am working on interfacing to a webservice which is giving me back some data that includes a day-of-year field, which I need to compare to current day-of-year. I am well aware about the pitfalls of relying on an accurate time from a user’s machine, and am fine with any problems that result from bad timezones and bogus date settings.
I am concerned, though, about users in locales that don’t use the Gregorian calendar, and what their browsers will give back if I use the .getDate(), .getMonth(), and .getFullYear() methods to compute day-of-year.
So, in practice, does "local time" in Javascript ever refer to a non-Gregorian calendar system, such as the Hebrew or Persian calendars?
From the ECMAScript specs (3rd edition and 5th edition are nearly identical in this regard, but am quoting the 5th):
LocalTZArefers to local time zone adjustment, andDaylightSavingTAis the adjustment for daylight savings.I have not found any evidence of a browser (current or historic) that does anything different when a non-Gregorian calendar is enabled on a user’s machine.