We can fix the month and day part of date object by using setmonth JavaScript function. We can set the month from 0 to 11. In this January month is taken as 0 month and December is taken as 11.
Sample code is here
<script type="text/javascript"> 
var dt= new Date();
document.write(dt + "<br><br>");
The output of above code

Try to change the month beyond 11 and see how the year part also change. Change this like this.
The output is here


More on JavaScript Date & Time

Post Comment This is for short comments only. Use the forum for more discussions.

HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us
©2000-2015 All rights reserved worldwide Privacy Policy Disclaimer