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 8497897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:15:22+00:00 2026-06-11T00:15:22+00:00

new Date(2) is: Thu Feb 01 2001 00:00:00 GMT-0500 (Eastern Standard Time) on Chrome

  • 0

new Date("2") is:

  • “Thu Feb 01 2001 00:00:00 GMT-0500 (Eastern Standard Time)” on Chrome
  • “Invalid Date” on Firefox and IE 9
  • “Thu, 01 Feb 2001 05:00:00 GMT” on node.js

Since node.js uses the google V8 javascript engine and Chrome is also from google, I suppose this is a googlish tweak.

This is bad. Is there an easy way to normalize the behavior of the Date type across the different platforms?

Thanks.

EDIT

Of course, “2” is not good for a date. But if one uses the “date” method of the jQuery validator plugin, then “2” is a perfectly valid input, because this particular validation method defers its logic to the Date javascript type to make the actual validation. Which makes perfect sense, if the Date type implementation is sensible. Which is apparently not the case in Chrome (and node.js).

  • 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-11T00:15:23+00:00Added an answer on June 11, 2026 at 12:15 am

    No. The ECMAScript specification states that the single parameter Date constructor, where that parameter is a string, will defer to Date.parse which is “implementation dependent”. Source: ECMAScript specification.

    Avoid using this constructor therefore if you want the same behaviour across implementations.

    If you have, for your application, a recognised meaning of the string "2" as a date, then you should implement your own logic to interpret it. There is no “standard” meaning for this. If you had something more recognisable to the world at large as your string, you’d find the different implementations behaved more similarly. But in your case you’d be advised to parse the string yourself and explicitly provide the meaning of the 2 to a more explicit constructor for Date.

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

Sidebar

Related Questions

If I do alert(new Date(1313690400000)) returns: Thu Aug 18 2011 13:00:00 GMT-0500 (CDT) however,
I have next date string: Thu Nov 14 0002 01:01:00 GMT+0200 (GTB Standard Time)
System.out.println(new Date()); Thu Feb 23 04:57:57 ACT 2012 I am running it in a
When I print the new java.util.Date() it prints this in Android Thu Feb 22
var date = new Date();//Mon Mar 15 2010 12:40:05 GMT+0300 (MSK) var omg =
when using new Date,I get something like follows: Fri May 29 2009 22:39:02 GMT+0800
Case One: new Date(Date.parse(Jul 8, 2005)); Output: Fri Jul 08 2005 00:00:00 GMT-0700 (PST)
a = new Date(); Sun Apr 08 2012 16:58:03 GMT+0530 (IST) Is there any
I'm not familiar with time operations in javascript. I tried new Date(); which gives
I called new Date(Jan 4) and found the default year is 2001 a=new Date(Jan

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.