Date.getMonth : getMonth « Date « JavaScript Tutorial






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>








12.11.getMonth
12.11.1.Date.getMonth
12.11.2.Translate the Date().getMonth() to month name
12.11.3.Date.getMonth() with switch statement