Mega Code Archive

 
Categories / JavaScript Tutorial / Date
 

Date getMonth

The getMonth() method returns the month portion of the Date object expressed as an integer from 0 (January) to 11 (December). <html> <head> <title>Current Month</title> </head> <body> <script language="JavaScript" type="text/javascript"> <!-- var current_date = new Date(); month_value = current_date.getMonth(); document.write("Current Month is " + month_value); //--> </script> </body> </html>