Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8069631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:06:50+00:00 2026-06-05T13:06:50+00:00

Does the Date object in Javascript ever use a non-Gregorian calendar? The MDN and

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:06:52+00:00Added an answer on June 5, 2026 at 1:06 pm

    From the ECMAScript specs (3rd edition and 5th edition are nearly identical in this regard, but am quoting the 5th):

    15.9.1.9 Local Time

    Conversion from UTC to local time is defined by

    LocalTime(t) = t + LocalTZA + DaylightSavingTA(t)

    Conversion from local time to UTC is defined by

    UTC(t) = t – LocalTZA – DaylightSavingTA(t – LocalTZA)

    Note that UTC(LocalTime(t)) is not necessarily always equal to t.

    LocalTZA refers to local time zone adjustment, and DaylightSavingTA is 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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It amazes me that JavaScript's Date object does not implement an add function of
Is there a native Javascript Matrix object? You know how theres a Date, Array,
Assuming a 32-bit OS/Browser, could a Date object created in JavaScript rollover to 1970
How does one extend core JavaScript types (String, Date, etc.) without modifying their prototypes?
I am trying to understand more about the Date object in javascript. I thought
Does anybody know which date format is to be used, trying to create a
How does one set the date on the CalendarDatePicker. i.e. it defaults to current
Does anyone have a good way of deleting duplicate transactions (same date, amount, biller,
Does anybody have any advice on working in a Date Driven Development environment? Essentially,
Does anyone know know how to programatically get the local date and time of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.