I am using mvc 4. When I use bellow code in script
new Date(2012, 12, 16, 03, 20, 00)
it return as
Wed Jan 16 2013 03:20:00 GMT+0530 (India Standard Time)
Please help me, I am not able to understand why does this happen, it should return
Sun Dec 16 2012 03:20:00 GMT+0530 (India Standard Time)
Months are 0 based. When you pass it 12, it’s essential month “13”, which Javascript will interpret as January of the next year.
So to get the date you want, the code would be
new Date(2012,11, 16, 03, 20, 00)