How to get the month form the current date in JavaScript

1 Answer

0 votes
<script type="text/JavaScript">   

var today = new Date();
var month = today.getMonth();

// getMonth return zero-based value (0 = first month of the year)
document.write(month + 1); 


/*
run:

5     

*/

</script>

 



answered May 30, 2016 by avibootz
...