Question: I have the following javascript code 

```
date.getMonth());

```

This returns me the name of the month in English, how can I get the languages in Italian or in an another language. What does the language option depend on? I mean, what determines the language of the returned variable, and how can I change this language? 

My full code is as follows; 

```
var currentTime = new Date() 
var minDate = new Date(currentTime.getYear(), currentTime.getMonth()-1); 
var maxDate =  new Date(currentTime.getFullYear(), currentTime.getMonth());

```

Answer: 
The getMonth() method returns the month (from 0 to 11) for the specified date, according to local time.

then create a month array as per required language..

Try this:-

```
<html>
<body>

<p id="demo">Click the button to display the name of this month.</p>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction()
{
var month=new Array();
month[0]="January";
month[1]="February";
month[2]="March";
month[3]="April";
month[4]="May";
month[5]="June";
month[6]="July";
month[7]="August";
month[8]="September";
month[9]="October";
month[10]="November";
month[11]="December";

var d = new Date();
var x = document.getElementById("demo");
x.innerHTML=month[d.getMonth()];
}
</script>

</body>
</html>

```

Hope this will help you..
I believe that instead of reinventing the wheel you can use a solid library.

> 
> **Moment.js**
> 
> 
> A javascript date library for parsing, validating, manipulating, and formatting dates.
> 
> 
> <http://momentjs.com/>
> 
> 
> 

If you really need to rewrite it then simply create an array of month names and based on the number of month pick corresponding name from the array.