Closed Bug 1723515 Opened 3 years ago Closed 3 years ago

Incorrect date parsing when date contains hyphens

Categories

(Core :: JavaScript: Standard Library, defect)

Firefox 90
defect

Tracking

()

RESOLVED DUPLICATE of bug 1439800

People

(Reporter: jk.bhu85, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0

Steps to reproduce:

Open console in Firefox browser. Create a date object by passing the value '21-Aug-2021' as the parameter to the constructor. The code for this would be new Date('21-Aug-2021').

Actual results:

In the output, it can be observed that the year is coming as a negative number. The exact output of the code is 'Tue Aug 21 -2021 00:00:00 GMT+0553 (India Standard Time)'.

Expected results:

The year should be positive number because hyphen is a separator not minus sign. Chrome parses the specified format correctly.

Blocks: 1274354
Component: JavaScript Engine → JavaScript: Standard Library
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1439800
No longer duplicate of bug: 1693692
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: