New issue
Advanced search Search tips

Issue 596457 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Date() function in DevTools > console doesn't function correctly.

Reported by rao.kenn...@gmail.com, Mar 21 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36

Steps to reproduce the problem:
1. In DevTools console create a custom instance of Date()
2. Example: var today = new Date(2016,01,01)
3. Type today and the console returns the incorrect date. It adds +1 to the month and displays the example as Mon Feb 01 2016. 

What is the expected behavior?
The console should display Jan 01 2016.

What went wrong?
The date function adds an extra month for a custom date. 

Did this work before? N/A 

Chrome version: 49.0.2623.87  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 21.0 r0
 
devtools-date.PNG
13.5 KB View Download
This is a Javascript thing. W3Schools even has a specific note for it:

"JavaScript counts months from 0 to 11. January is 0. December is 11."

- http://www.w3schools.com/js/js_dates.asp
Status: WontFix (was: Unconfirmed)
One more document which says it's zero-based: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

Sign in to add a comment