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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:56:49+00:00 2026-05-26T23:56:49+00:00

Why Date.parse(2011-11-15) considers current time zone in Web browser, and Date.parse(2011/11/15) does not? Why

  • 0

Why Date.parse("2011-11-15") considers current time zone in Web browser, and Date.parse("2011/11/15") does not? Why the results are different?

  • 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-05-26T23:56:50+00:00Added an answer on May 26, 2026 at 11:56 pm

    The first form is being considered as an ISO date in UTC, according to section 15.9.1.15 of ECMA-262. The second form is being considered in an implementation-specific way, as per section 15.9.4.2:

    The parse function applies the ToString operator to its argument and interprets the resulting String as a date
    and time; it returns a Number, the UTC time value corresponding to the date and time. The String may be
    interpreted as a local time, a UTC time, or a time in some other time zone, depending on the contents of the
    String. The function first attempts to parse the format of the String according to the rules called out in Date Time String Format (15.9.1.15). If the String does not conform to that format the function may fall back to any
    implementation-specific heuristics or implementation-specific date formats

    So I suspect “2011/11/15” is being converted to the local midnight of November 15th, whereas “2011-11-15” is being converted to UTC midnight of November 15th.

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

Sidebar

Related Questions

I want to be able to parse this date-time format 2011-12-02T16:18:12.479-05:00 into an mm/dd/yy
today1 = new Date(); today2 = Date.parse(2008-28-10); To compare the time (millisecond) values of
I'm using DateJS to parse user-inputted dates, and getting some strange results. Date.parse(15 Jan
I'm trying to parse a date/time string using DateTime.ParseExact . It works everywhere, except
I'm using java.text.SimpleDateFormat to parse string representations of date/time values inside an XML document.
I need to parse a String that does not originally have the year set
I use chronic to return parsed date objects like so: last_pay_date = Date.parse(Chronic.parse('2011-11-04').strftime(%Y-%m-%d)) two_weeks_ago
I have this simple code: SimpleDateFormat format = new SimpleDateFormat(yyyy-MM-dd); Date date = format.parse(2011-10-29);
SimpleDateFormat dateFormat = new SimpleDateFormat(mm/dd/yyyy); Date date = dateFormat.parse(11/04/2011); System.out.println(date); System.out.println(dateFormat.format(date)); Tue Jan 04
String str = 13/06/2011; SimpleDateFormat formatter = new SimpleDateFormat(dd/MM/yyyy); Date date = (Date)formatter.parse(str);

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.