Return actual month number : Date Extension « Date Time « JavaScript DHTML






Return actual month number

  


<html>
<head>
  
  <script type="text/javascript">
    Date.prototype.getActualMonth = getActualMonth;

    function getActualMonth() {
      var n = this.getMonth();
      n += 1;
      return n;
    }
  </script>
</head>
<body>
<script type="text/javascript">
  var today = new Date();
  alert(today.getActualMonth());
</script>

</body>
</html>

   
    
  








Related examples in the same category

1.Add user defined function method to Date object
2.Return the actual day number from a date
3.Get calendar day in English
4.Return English name from date object