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: 
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.
Date.getMonth() does not return the name of the month, it returns an integer 0..11 representing January..December

If you want the name of the month in your locale language, then see this SO question and the different answers [Get month name from Date](https://stackoverflow.com/questions/1643320/get-month-name-from-date-using-javascript)

I find this particular answer <https://stackoverflow.com/a/16089495/30447> specially useful for your case.