I am trying to change my date format
var d = new Date();
var curr_year = d.getFullYear();
var curr_Month = d.getMonth() +1;
var curr_date = d.getDate();
var todayDate = var tDate = ( curr_Month +"/"+curr_date +"/"+ curr_year);
This is working perfectly fine ,But for the month November it shows 10,instead of 11 and for the month of December it shows 11 instead of 12 …for the rest of months it all fine ..
NOTE : This problem is only in mozilla and opera ,in internet explorer its working fine !
Any idea
Thanks
This works fine for me, producing
11/23/2011which is the current date in my timezone as of this answer, despite being that weird USA format 🙂This was tested in both Firefox 8 and IE 9 with the following HTML file:
That last line of yours is not syntax I’ve seen before and, in fact, it stops the script from working at all. In IE9, you get:
and Firefox 8 gives you: