Return English name from date object : Date Extension « Date Time « JavaScript DHTML






Return English name from date object

  


<html>
<head>
  
  <script type="text/javascript">
    Date.prototype.getCalendarMonth = getCalendarMonth;
    function getCalendarMonth() {
      var n = this.getMonth();
      var moy = new Array(12);
      moy[0] = "January";
      moy[1] = "February";
      moy[2] = "March";
      moy[3] = "April";
      moy[4] = "May";
      moy[5] = "June";
      moy[6] = "July";
      moy[7] = "August";
      moy[8] = "September";
      moy[9] = "October";
      moy[10] = "November";
      moy[11] = "December";
      return moy[n];
    }
  </script>
</head>
<body>
<script type="text/javascript">
  var today = new Date();
  alert(today.getCalendarMonth());
</script>

</body>
</html>

   
    
  








Related examples in the same category

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