Option 1: Display Current Month by Name From Array
Here we first create an array with all the month names, then we will use the index as a key to finding the month we want.
Create an array with all the month names, and so use your index as a key to finding the current month as shown here.
The code above outputs the current month. The method above is not very portable and is error-prone as it relies heavily on what you put into the array.
Option 2: Using the Built-In toLocaleDateString Method
The new locales and options arguments let applications specify the language whose formatting conventions should be used and allow to customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation-dependent.
To display a specific month based on a different date you can replace the above and use the UTC() method like so:
Ref: [ 1 ]