why new Date("Tue Apr 08 2008 00:00:00 GMT+0530").getMonth() is returning 3

user3205479
new Date("Tue Apr 08 2008 00:00:00 GMT+0530").getMonth() returns 3?

Why does this datetime format returns -1 month. Also can any one please tell me is this UTC timestamp or GMT or ISO. I am pretty confused. Any help is greatly appreciated.

Karl Reid

The month field is 0 indexed :

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

month

Integer value representing the month, beginning with 0 for January to 11 for December.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Why was getMonth deprecated on java.sql.Date and java.util.Date

the Date.getMonth() method has bug?

Why does a call to Javascript's Date library such as date.setMonth(date.getMonth()-1) return 1426456040720 here?

Why is 'new Promise(...)' returning 'undefined'?

I'm getting JavaScript error "d.getMonth is not a function" when trying to format a date using d3.time.format

JavaScript new Date() Returning NaN in IE, Safari

getmonth() is not a function error parsing date

Why is (new Date() == new Date()) false, but (Date() == Date()) is true?

Angular 2 - date.getMonth is not a function

Why is new Date() returning the wrong timezone in Chrome?

Change the month of a Date object without returning a new date

new Date() returning invalid date unless * by 1?

new Date returning invalid Date safari

Why is my formula returning a number instead of a date?

Why is date function not returning me expected output?

As3 Date Object Not Returning Hours Correctly

Why is Time.strptime() returning the current date?

If date > curDate returning wrong result, WHY?

Why EncdDecd.EncodeStream is returning a new line?

Strange behaviour of Date.getMonth() - Month difference

Converting DateTime to EPOCH time is returning a new Date

Why new Date returns wrong date?

Why getBoundingClientRect is not returning new value after resize

When using date.getMonth(), why is my result off by 3?

Why new Date() with `T17:00:00.000Z` is returning the next date?

Why group by date is returning multiple rows for the same date?

Why is getDay() and getMonth() returning wrong values

Why is this not returning 3 as a prime?

Why sometimes returning a new List containing the List?